Re: [R] Finding Values that Occur Most Often in a Vector

2008-07-09 Thread Duncan Mackay
If you just want the value which is the most frequent try as.numeric(names(which.max(table(c( -295.8045 ,-295.8045, -295.8045, -295.8045 ,-325.4754 ,-295.8045, -295.8045, -295.8045, -413.2099, -295.8045) [1] -295.8045 There may be easier ways Regards Duncan Mackay Department of Agronomy

Re: [R] Finding Values that Occur Most Often in a Vector

2008-07-09 Thread hpages
Hi Gundala, This would be a way to do it: names(which.max(table(myvector))) For example: > set.seed(99) > y <- sample(letters[1:3], 40, replace=TRUE) [1] "b" "a" "c" "c" "b" "c" "c" "a" "b" "a" "b" "b" "a" "b" "c" "b" [17] "b" "a" "a" "a" "a" "a" "c" "b" "c" "b" "a" "c" "a" "a" "b"

[R] Finding Values that Occur Most Often in a Vector

2008-07-09 Thread Gundala Viswanath
Hi, Is there a way to do it? For example I have the following vector: > print(myvector) > [1] -295.8045 -295.8045 -295.8045 -295.8045 -325.4754 -295.8045 -295.8045 [8] -295.8045 -413.2099 -295.8045 I want it to return -295.8045, which occur most often. - Gundala Viswanath Jakarta - Indonesia

Re: [R] Parallel R

2008-07-09 Thread Juan Pablo Romero Méndez
Just out of curiosity, what system do you have? These are the results in my machine: > system.time(exp(m), gcFirst=TRUE) user system elapsed 0.520.040.56 > library(pnmath) > system.time(exp(m), gcFirst=TRUE) user system elapsed 0.660 0.016 0.175 Juan Pablo > >> syst

Re: [R] Lattice: merged strips?

2008-07-09 Thread Duncan Mackay
Mike see ?strip.custom and strip.default Basically you need to create a string of factor levels equal to the number of panels. Below is an example for a plot of 24 panels 4 columns and six rows. so that row 1 is: "2000 Summer" | "2000 Autumn" | "2000 Winter" | "2000 Spring" and so on for the

Re: [R] Thanks!

2008-07-09 Thread R_Learner
Thanks! I'll use the which.min function. I've been learning R from the pdfs on the CRAN website, but I find the texts to be generally introductory, not comprehensive, and focused on one niche purpose. Can anyone suggest a good self-teach guide? Thanks again! R_Learner wrote: > > I have a long

[R] Lattice: merged strips?

2008-07-09 Thread Mike Lawrence
Hi all, By default a call to xyplot from the Lattice package when using 2 factors [eg xyplot( dv~iv | XY * AB ) ] yields the following shingle structure: |_A_|_A_|_B_|_B_| |_X_|_Y_|_X_|_Y_| However, I'm wondering if it is possible to merge the upper shingle within levels of that factor,

Re: [R] childNames for xaxis grob (grid package)

2008-07-09 Thread Paul Murrell
Hi Tobias Verbeke wrote: > Dear list, > > Can someone explain why the childNames below > gives > > character(0) > > instead of the (canonical) names of the children grobs > of the xaxis gTree ? > > [1] "major" "ticks" "labels" The problem is that you xaxis has an 'at' component of NULL, w

Re: [R] version problems of rkward in ubuntu hardy repository

2008-07-09 Thread Vincent Goulet
Le mer. 09 juil. à 06:20, Rainer M Krug a écrit : Hi I tried to install rkward under ubuntu hardy heron, but it tried to use the one from the cran repository which was newer, but it did not install. To be able to install rkward, I had to disable the cran repository, install rkward, lock it's ve

[R] “Check” problem

2008-07-09 Thread leeznar
Dear all: I ‘m a newer. I have some problem when I check my package. The error messages were as follows. It shows that the problem is about Rd file. How can I find where the error is? How can I do?? c:\temp>Rcmd check bear * checking for working pdflatex ... OK * using log directory 'c:/tem

Re: [R] Help on Installing Matrix Package in Linux (Fedora)

2008-07-09 Thread Marc Schwartz
Indeed. Presumably R was installed using an RPM from the Fedora repository and the 'devel' RPM, which contains the requisite header files was not. Using: # yum install R-devel should get you moving forward. BTW, there is a new Fedora specific e-mail list for R. More info here: https://

Re: [R] shifting data in matrix by n rows

2008-07-09 Thread jim holtman
Is this what you want: > x <- read.table(textConnection("Date Apples Oranges Pears + 1/7 2 35 + 2/7 1 47 + 3/7 3 810 + 4/7 5 72 + 5/7 6 35"), header=TRUE) > closeAllCo

Re: [R] shifting data in matrix by n rows

2008-07-09 Thread Gabor Grothendieck
If its a zoo or ts time series you can use the lag function. On Wed, Jul 9, 2008 at 2:57 PM, rcoder <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > I have some data in a matrix, and I want to shift it down by one row. The > matrix in question has a date column. Does anyone know of a way to shift t

Re: [R] Help on Installing Matrix Package in Linux (Fedora)

2008-07-09 Thread Krzysztof Sakrejda-Leavitt
Maybe I am wrong about this, but I think your problem is actually: Mutils.h:9:41: error: R.h: No such file or directory Mutils.h:10:22: error: Rversion.h: No such file or directory Mutils.h:11:56: error: Rdefines.h: No such file or directory I think these are important files for compiling additi

Re: [R] Strptime/ date time classes

2008-07-09 Thread Gabor Grothendieck
Suggest you read the relevant article in R News 4/1. Also the zoo package and read.zoo, in particular, might help. On Wed, Jul 9, 2008 at 6:09 AM, Caroline Keef <[EMAIL PROTECTED]> wrote: > Dear all, > > I've come across a problem using strptime, can anyone explain what's > going on? I'm using ve

Re: [R] Basic help needed

2008-07-09 Thread Gabor Grothendieck
Right click the R icon and choose Run As Administrator and then install the package. This is only needed for package installation if you don't have have a local library in your home tree and also is not needed for just everyday running of R. On Wed, Jul 9, 2008 at 9:15 PM, Luciano La Sala <[EMAIL

Re: [R] Summary Stats (not summary(x))

2008-07-09 Thread nmarti
OK, never-mind. I found length(x). It's been a long day. Gabor Csardi wrote: > > Why don't you write it for yourself, it takes less time than writing > an email: > > mysummary <- function(x) { > require(plotrix) > require(e1071) > c(Mean=mean(x), Std.Error=std.error(x), Std.Deviation=sd

Re: [R] Summary Stats (not summary(x))

2008-07-09 Thread Gabor Grothendieck
The two describe functions have it. Maybe the one in psych too? Also see valid.n in the prettyR package and of course there is length, nrows and dim. On Wed, Jul 9, 2008 at 8:53 PM, nmarti <[EMAIL PROTECTED]> wrote: > > Thanks Gabor. > I was able to create a function that works really well. One

[R] Basic help needed

2008-07-09 Thread Luciano La Sala
Hello all, New user here. I have R 2.7.1. installed, but don’t have internet access in my PC. Therefore, I downloaded the ISwR package (Introductory Statistics with R) from CRAN and then moved it into my HD. I can’t seem to install the local package under Windows Vista system. I've tried using

Re: [R] shifting data in matrix by n rows

2008-07-09 Thread rcoder
Original Table: Date Apples Oranges Pears 1/7 2 35 2/7 1 47 3/7 3 810 4/7 5 72 5/7 6 35 What I want after shift (data shifted, dates left unchanged) Date Apples O

[R] matplot help

2008-07-09 Thread Boyce, Morgan
Hi, My question is how do I gain control over what values the X and Y axis show. Below is a sample plot I have made and want the X axis to represent a time vector with values taking the form Q1.60, Q2.60, Q3.60...Q1.90..etc...Currently the X axis starts with value 0 and increases by 1 through t

Re: [R] rbinom for a matrix

2008-07-09 Thread ACroske
Yes I do want a random assignment, instead of rounding. (From what I understand of the rbinom command, it will randomly assign 1 or 0, and the higher the given probability, the higher the likelihood of a 1... Feel free to correct me if I'm wrong!) Ben Bolker wrote: > > -BEGIN PGP SIGNED ME

Re: [R] rbinom for a matrix

2008-07-09 Thread ACroske
Ben: Thanks for the reply. One further question, and this is where my novice status at R shows through. The code makes sense, but what would I put it for "m"? Is it the same number for all three (that was my first thought since it was the same placeholder for all three). Number of rows in the matr

Re: [R] Summary Stats (not summary(x))

2008-07-09 Thread nmarti
Thanks Gabor. I was able to create a function that works really well. One more quick question if you don't mind. I want to report the number of observations also (i.e. n = 5420). What function would do this? I really can't find anything that would just simply count the number of x's. Thanks aga

[R] Help on Installing Matrix Package in Linux (Fedora)

2008-07-09 Thread Hyunseung Kang
Hi, I have been trying to install the Matrix package on R running in Linux (Fedora). But, I get the following error message (at the bottom). I am logged in as the root user. Any help would be appreciated! Thanks! -Hyunseung Kang * Installing *source* package 'Matrix' ... Using GNU make for b

Re: [R] Sweave figure

2008-07-09 Thread Duncan Murdoch
Georg Otto wrote: Hi, I have a problem using figures in Sweave: To save my figures, I use \SweaveOpts{prefix.string=figures/figure} I adjust the figure size for my pdf document using <>= this works fine. The file figures/figure-graphicsFun.pdf has the right size, and so has the figur

Re: [R] Grid building in R

2008-07-09 Thread Dylan Beaudette
On Wednesday 09 July 2008, hippie dream wrote: > This might not possible in R but I thought I would give it shot. I am have > to set up a 40 x 40 cm grid of 181 points equidistant from each other. Is > there any way to produce a graph with R that can do this for me? Actual > sizes are unimportant a

Re: [R] Grid building in R

2008-07-09 Thread Sam Albers
Ahhh. That worked perfectly. Thank you very much. On Wed, Jul 9, 2008 at 4:19 PM, Dylan Beaudette <[EMAIL PROTECTED]> wrote: > On Wednesday 09 July 2008, hippie dream wrote: > > This might not possible in R but I thought I would give it shot. I am > have > > to set up a 40 x 40 cm grid of 181 poi

[R] Help navigating documentation for descriptive statistics

2008-07-09 Thread Ted
I am still trying to get used to R, and apparently haven't found the right place in the documentation to see how to do what I want in R. If I were to do this in C++, there'd be no problem: I'd write it all myself, but I want to learn R well enough it can save me a lot of coding time. Here is t

Re: [R] Grid building in R

2008-07-09 Thread Sam Albers
Basically, I want 181 points equally spaced over a 40 x 40 cm area. I want to be able to specify the number of points and the area to which they are plotted on. I think you are right that grid is what I am looking for but I was the grid to have axes which your code below, although appreciated, did

Re: [R] Grid building in R

2008-07-09 Thread Erik Iverson
Still not sure exactly what you want, but it sounds like the 'grid' package may be of some help. It has very flexible ways partitioning regions for plotting. Is this anything like you're after? library(grid) for(i in 0:10) for(j in 0:10) grid.points(i / 10, j / 10, default.unit = "npc

Re: [R] use variable value as vector name

2008-07-09 Thread Erik Iverson
a <- "apple" b <- "pear" c <- "banana" result <- c(2, 3, 5) names(result) <- c(a, b, c) Qian R wrote: Here is my problem a <- data$name[1] b <- data$name[2] c <- data$name[3] a "apple" b "pear" c "banana" result <- c( a = 2 , b=3, c=5) output: a b c 2 3 5 But I want my output

[R] use variable value as vector name

2008-07-09 Thread Qian R
Here is my problem   a <- data$name[1]  b <- data$name[2] c <- data$name[3]   a "apple" b "pear" c "banana"   result  <- c( a = 2 , b=3, c=5)   output: a  b c 2  3 5   But I want my output apple  pear  banana 2 3 5 [[alternative HTML version deleted]] __

Re: [R] Grid building in R

2008-07-09 Thread Sam Albers
Right equidistant was clearly the wrong word. Sorry. I just meant that any given point should have an equal distance from the four points immediately surrounding it (x,-x,y-y) aside from those on the edge which will obviously only have two or three points surrounding. On Wed, Jul 9, 2008 at 3:12 P

Re: [R] Grid building in R

2008-07-09 Thread hadley wickham
What do you mean by equidistant? You can have three points that are equidistant on the plane, but there's no way to add another point and have it be the same distance from all of the existing points. (Unless all the points are in the same place) Hadley On Wed, Jul 9, 2008 at 5:02 PM, hippie dre

Re: [R] Auto.key colors maintained when subsetting

2008-07-09 Thread David Afshartous
I've determined that the problem with getting the subsetting to work with the error bars was related to not dropping the unused levels of the Grouping factor. The simplest solution was to follow a combination of Deepayan's suggestions 1 and 2 below, i.e., supply one's own colors and subset before

[R] Grid building in R

2008-07-09 Thread hippie dream
This might not possible in R but I thought I would give it shot. I am have to set up a 40 x 40 cm grid of 181 points equidistant from each other. Is there any way to produce a graph with R that can do this for me? Actual sizes are unimportant as long it is to scale. Thanks -- View this message in

Re: [R] zoo and cex

2008-07-09 Thread Marc Schwartz
on 07/09/2008 04:38 PM stephen sefick wrote: I am plotting a twelve panel plot of a zoo object. I have tried to raise the cex from 0.6 to 1 to 2 and it does not seem to do anything. I am trying to output this to a tiff file tiff() how do I get the labels of a larger font size Stephen I had t

Re: [R] recursively divide a value to get a sequence

2008-07-09 Thread Erik Iverson
base , if you're not seeing it, upgrade your version of R to the latest. Carl Witthoft wrote: Query: what package is Reduce in? (per GG's suggestion to use it) thanks Carl __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] recursively divide a value to get a sequence

2008-07-09 Thread Carl Witthoft
Query: what package is Reduce in? (per GG's suggestion to use it) thanks Carl __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide com

[R] zoo and cex

2008-07-09 Thread stephen sefick
I am plotting a twelve panel plot of a zoo object. I have tried to raise the cex from 0.6 to 1 to 2 and it does not seem to do anything. I am trying to output this to a tiff file tiff() how do I get the labels of a larger font size Stephen -- Let's not spend our time and resources thinking abo

Re: [R] Auto.key colors maintained when subsetting

2008-07-09 Thread Deepayan Sarkar
On 7/9/08, David Afshartous <[EMAIL PROTECTED]> wrote: > > > > On 7/9/08 1:07 PM, "Deepayan Sarkar" <[EMAIL PROTECTED]> wrote: > > > On 7/9/08, David Afshartous <[EMAIL PROTECTED]> wrote: > >> > >> > >> All, > >> > >> I'm plotting points and lines for various groups. > >> I'd like subseq

Re: [R] randomly select duplicated entries

2008-07-09 Thread Marc Schwartz
on 07/09/2008 02:17 PM Juliet Hannah wrote: Using this data as an example dat <- read.table(textConnection("Id myvar 12 1 12 2 12 6 34 9 34 4 34 8 65 15 65 23"), header = TRUE) closeAllConnections() how can I create another data set that does not have duplicate entries for 'Id', but the

Re: [R] randomly select duplicated entries

2008-07-09 Thread jim holtman
How about this: > dat <- read.table(textConnection("Id myvar + 12 1 + 12 2 + 12 6 + 34 9 + 34 4 + 34 8 + 65 15 + 65 23"), header = TRUE) > closeAllConnections() > # split by the id and then choose one > x <- lapply(split(dat, dat$Id), function(.grp){ + .grp[sample(seq(length(.grp)), 1)

Re: [R] Read.table - Less rows than original data

2008-07-09 Thread Philipp Pagel
> I built a 1,273,230 by 6 data set named "mydata2", it was saved in the > following command, > > write.table(mydata2, "mydata2.txt", row.name=F,col.name=T,quote=F,sep="\t") > > The next day I read in above saved text file into R, > > temp<-read.table("mydata2.txt",header=T,sep="\t",na.strings=

Re: [R] randomly select duplicated entries

2008-07-09 Thread Henrique Dallazuanna
Try this: do.call(rbind, lapply(split(dat, dat$Id), function(x)x[sample(1:nrow(x), 1),])) On 7/9/08, Juliet Hannah <[EMAIL PROTECTED]> wrote: > Using this data as an example > > dat <- read.table(textConnection("Id myvar > 12 1 > 12 2 > 12 6 > 34 9 > 34 4 > 34

Re: [R] shifting data in matrix by n rows

2008-07-09 Thread jim holtman
Can you provide commented, minimal, self-contained, reproducible code. If you don't have code, at least provide a before/after version of the matrix that you would like. It is easy to use indexing to move stuff around, we just have to know what is it that you want to move. On Wed, Jul 9, 2008 at

Re: [R] rbinom for a matrix

2008-07-09 Thread Dylan Beaudette
On Wednesday 09 July 2008, Ben Bolker wrote: > Dylan Beaudette wrote: > | On Wednesday 09 July 2008, Ben Bolker wrote: > |> ACroske yahoo.com> writes: > |>> I have a large matrix full of probabilities; I would like to convert > > each > > |>> probability to a 1 or a 0 using rbinom. > |>> How can I

[R] read.table problem

2008-07-09 Thread phoebe kong
Dear all, I have problem when reading a table into R. The total row of read in table has is much less than the original saved table. I built a 1,273,230 by 6 data set named "mydata2", it was saved in the following command, write.table(mydata2, "mydata2.txt", row.name=F,col.name=T,quote=F,sep="\t

Re: [R] Port package

2008-07-09 Thread hadley wickham
On Wed, Jul 9, 2008 at 3:09 PM, Ben Bolker <[EMAIL PROTECTED]> wrote: > Katharine Mullen few.vu.nl> writes: > >> >> It is not an R package, but rather a collection of Fortran functions >> that R uses from netlib: >> http://www.netlib.org/port/ >> > > Where is Martin Maechler when we need him? > "

[R] randomly select duplicated entries

2008-07-09 Thread Juliet Hannah
Using this data as an example dat <- read.table(textConnection("Id myvar 12 1 12 2 12 6 34 9 34 4 34 8 65 15 65 23"), header = TRUE) closeAllConnections() how can I create another data set that does not have duplicate entries for 'Id', but the included values are randomly selected from th

[R] shifting data in matrix by n rows

2008-07-09 Thread rcoder
Hi everyone, I have some data in a matrix, and I want to shift it down by one row. The matrix in question has a date column. Does anyone know of a way to shift the data by one row, whilst preserving the date column in the matrix - i.e. shift the data and leave the date column in the current locat

Re: [R] Read.table - Less rows than original data

2008-07-09 Thread Ben Bolker
phoebe kong gmail.com> writes: > I built a 1,273,230 by 6 data set named "mydata2", it was saved in the > following command, > > write.table(mydata2, "mydata2.txt", row.name=F,col.name=T,quote=F,sep="\t") > > The next day I read in above saved text file into R, > > temp<-read.table("mydata2.tx

[R] ftp directory

2008-07-09 Thread Yuri Volchik
Hi, is it possible to get content of ftp directory similar to for local files? Directory is password protected. Thanks -- View this message in context: http://www.nabble.com/ftp-directory-tp18368309p18368309.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Port package

2008-07-09 Thread Ben Bolker
Katharine Mullen few.vu.nl> writes: > > It is not an R package, but rather a collection of Fortran functions > that R uses from netlib: > http://www.netlib.org/port/ > Where is Martin Maechler when we need him? "That's not a package, that's a library!" :-) Ben ___

Re: [R] Find the closest value in a list or matrix

2008-07-09 Thread Jorge Ivan Velez
Hi there, Is this what you want? your.number=5.43 # For a vector x=c(1,2,4,3,2,5,6,7,5.42,6) which.min(abs(x-your.number)) [1] 9 # For a matrix set.seed(123) X=matrix(rpois(100,4.5),ncol=10) apply(X,2,function(x) which.min(abs(x-your.number))) [1] 9 3 2 3 2 5 1 2 2 2 HTH, Jorge On Wed, Ju

Re: [R] Question regarding lu in package Matrix

2008-07-09 Thread Ulrike Grömping
No, not at all, I'm glad that I do get the decomposition for non-square matrices. My problem is not with elu$U but with as.matrix(elu$U), which is not an upper diagonal matrix. Can I do something to fix this ? Regards, Ulrike Douglas Bates-2 wrote: > > On Wed, Jul 9, 2008 at 12:01 PM, Ulrike G

Re: [R] Auto.key colors maintained when subsetting

2008-07-09 Thread David Afshartous
On 7/9/08 1:07 PM, "Deepayan Sarkar" <[EMAIL PROTECTED]> wrote: > On 7/9/08, David Afshartous <[EMAIL PROTECTED]> wrote: >> >> >> All, >> >> I'm plotting points and lines for various groups. >> I'd like subsequent plots done on subsets to maintain the color assignments >> from the origin

Re: [R] rbinom for a matrix

2008-07-09 Thread Ben Bolker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dylan Beaudette wrote: | On Wednesday 09 July 2008, Ben Bolker wrote: |> ACroske yahoo.com> writes: |>> I have a large matrix full of probabilities; I would like to convert each |>> probability to a 1 or a 0 using rbinom. |>> How can I do this on the

Re: [R] netCDF to TIFF

2008-07-09 Thread Yasir Kaheil
the function is there in grDevices http://stat.ethz.ch/R-manual/R-patched/library/grDevices/html/png.html type ? png if tiff() is not listed, you need to update R to get the new base with new grDevices. thanks y Daniel Steinberg wrote: > > Greetings R users! > > I am working with the ENSEM

Re: [R] Find the closest value in a list or matrix

2008-07-09 Thread Tobias Verbeke
Daniel Malter wrote: x=c(1:100) your.number=5.43 which(abs(x-your.number)==min(abs(x-your.number))) or [depending on the problem]: which.min(abs(x-your.number)) HTH, Tobias - cuncta stricte discussurus - -Ursprüngliche Nachricht- Vo

Re: [R] rbinom for a matrix

2008-07-09 Thread Dylan Beaudette
On Wednesday 09 July 2008, Ben Bolker wrote: > ACroske yahoo.com> writes: > > I have a large matrix full of probabilities; I would like to convert each > > probability to a 1 or a 0 using rbinom. > > How can I do this on the entire matrix? The matrix was converted from a > > raster ArcMap dataset,

Re: [R] Strptime/ date time classes

2008-07-09 Thread jim holtman
Even using POSIXlt it seems to work fine when you are looking for NAs in the dates (ones that did not convert correctly. So you must be doing something different or your data is different from the example you have in the mail. You are always requested to provide commented, minimal, self-contained

Re: [R] rbinom for a matrix

2008-07-09 Thread Erik Iverson
Is this what you're looking for? test <- matrix(runif(100, 0, 1), nrow = 20) nr <- nrow(test) matrix(sapply(test, rbinom, n = 1, size = 1), nrow = nr) ACroske wrote: I have a large matrix full of probabilities; I would like to convert each probability to a 1 or a 0 using rbinom. How can I do th

[R] Read.table - Less rows than original data

2008-07-09 Thread phoebe kong
Dear all, I have problem when reading a table into R. The total row of read in table has is much less than the original saved table. I built a 1,273,230 by 6 data set named "mydata2", it was saved in the following command, write.table(mydata2, "mydata2.txt", row.name=F,col.name=T,quote=F,sep="\t

Re: [R] outlining symbol in legend with blackline

2008-07-09 Thread Yasir Kaheil
yes use plotting chars 22, 21 replace your legend statement with: legend(x="topright", legend=c("2006 mean", "2007 mean", "2008 mean", "1964-2005 mean \n max and min flows "), pch=c(22, 22, 22, 21), col=c(1,1,1,1), pt.bg=c(grey.colors(3, gamma=4),"black"), cex=1.5) box(which="plot", lty="solid

Re: [R] rbinom for a matrix

2008-07-09 Thread Ben Bolker
ACroske yahoo.com> writes: > > > I have a large matrix full of probabilities; I would like to convert each > probability to a 1 or a 0 using rbinom. > How can I do this on the entire matrix? The matrix was converted from a > raster ArcMap dataset, so the matrix is essentially a map. Because of

[R] "Rotated Lat-Lon" projection in mapproj

2008-07-09 Thread Victor Homar
Hi, I'm trying to plot a field obtained from the atmospheric model WRF-NMM which uses a "Rotated Lat-Lon¨ map projection. The WRF documentation mentions that: · Rotates the earth's lat/lon grid such that the intersection of the equator and prime meridian is at the center of the model domain.

Re: [R] plot gam "main effect functions" in one graph

2008-07-09 Thread Daniel Malter
Hi, there may be a more elegant way of doing this, but at least it works. You have to be careful about putting the same axis limits in both graphs and to use axis-labels in only one of them. ##generate data x1=c(1:100) e1=rnorm(100,0,10) e2=rnorm(100,0,30) x1=x1+e1 x2=x1+e2 y1=100+x1+0.025*x1^2+e1

[R] Sweave figure

2008-07-09 Thread Georg Otto
Hi, I have a problem using figures in Sweave: To save my figures, I use \SweaveOpts{prefix.string=figures/figure} I adjust the figure size for my pdf document using <>= this works fine. The file figures/figure-graphicsFun.pdf has the right size, and so has the figure in the final pdf doc

[R] question on FARIMA innovations

2008-07-09 Thread otunno
Hello everyone - I am currently modeling some data with ARIMA(p,d,q), and have successfully used the "fracdiff" package to obtain estimates for d and the ARMA parameters. However, I don't know how to get fracdiff to obtain innovations for me. Can fracdiff even do this? Can any other package? Plea

Re: [R] garchFit problem

2008-07-09 Thread Shirin Safa
Hi, I have a problem using garchFit, when I use : x<-model$resid fit = garchFit(~garch(1, 1), data = x, cond.dist="dst") [EMAIL PROTECTED] it gives me error : object "fit" not found Why it doesn't recognize fit? Thanks, Shirin __ R-help@r-pro

Re: [R] rollmean()

2008-07-09 Thread stephen sefick
I am going to assume your data.frame is called x #this transposes the matrix x.t <- t(x) rollmean(x.t) On Wed, Jul 9, 2008 at 12:50 PM, Rheannon <[EMAIL PROTECTED]> wrote: > > Hello, > > I am trying to calculate a 31 day running mean in some temperature data > along ROWS. Rollmean() works great a

Re: [R] rollmean()

2008-07-09 Thread Gabor Grothendieck
See ?t On Wed, Jul 9, 2008 at 12:50 PM, Rheannon <[EMAIL PROTECTED]> wrote: > > Hello, > > I am trying to calculate a 31 day running mean in some temperature data > along ROWS. Rollmean() works great along columns, but how do I perform this > same action on my rows? > > The data is a matrix of 365

[R] rbinom for a matrix

2008-07-09 Thread ACroske
I have a large matrix full of probabilities; I would like to convert each probability to a 1 or a 0 using rbinom. How can I do this on the entire matrix? The matrix was converted from a raster ArcMap dataset, so the matrix is essentially a map. Because of this, I have no column headings. Thanks!

Re: [R] Find the closest value in a list or matrix

2008-07-09 Thread Daniel Malter
x=c(1:100) your.number=5.43 which(abs(x-your.number)==min(abs(x-your.number))) Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von R_Learner Gesendet: Wedne

Re: [R] Strptime/ date time classes

2008-07-09 Thread Caroline Keef
Thank you, but why does this happen? a =(1:223960)[is.na(datetimes)] datetimes[a] > [1] "1981-03-29 01:20:00" "1990-03-25 01:43:00" "1992-03-29 01:43:00" > "1996-03-31 01:30:00" "1996-03-31 01:57:00" [6] "1997-03-30 01:02:00" > "1997-03-30 01:14:00" "1997-03-30 01:27:00" "1997-03-30 01:44:00"

Re: [R] Find the closest value in a list or matrix

2008-07-09 Thread Henrique Dallazuanna
Try this: which.min(abs(x - 5.43)) where x is your vector of numbers. On Wed, Jul 9, 2008 at 12:28 PM, R_Learner <[EMAIL PROTECTED]> wrote: > > I have a long list of numbers [3.4,5.4,3.67,], and I basically want to > find the index of the number closest to this number that I have, let's sa

[R] build matrix with the content of one column of a data frame in function of two factors

2008-07-09 Thread VinceD
Hello, First, thanks for your help (and sorry for my english !) I have a data frame in which each row represents a vote (in percent, only 20,40, 60,80,100) of one person on one content, with three columns : name (the name of the voters), content_id, vote : str(votesredac) 'data.frame': 1000 o

Re: [R] build matrix with the content of one column of a data frame in function of two factors

2008-07-09 Thread VinceD
Seems that the following makes what I want : attach(votesredac) tapply(value, list(name, content_id), mean) Only thing is, I don't need to make a mean - there is only one or no value. VinceD wrote: > > Hello, > > First, thanks for your help (and sorry for my english !) > > I have a data fr

Re: [R] Summary Stats (not summary(x))

2008-07-09 Thread nmarti
Thanks for your replies. basicStats(x) in "fBasics" is exactly what I was looking for. > > nmarti wrote: > > I'm looking for a function that lists a few summary stats for a column (or > row) of data. I'm aware of summary(x), but that does not give me what I'm > looking for. > I'm actually looki

[R] rollmean()

2008-07-09 Thread Rheannon
Hello, I am trying to calculate a 31 day running mean in some temperature data along ROWS. Rollmean() works great along columns, but how do I perform this same action on my rows? The data is a matrix of 365 columns (days of the year) by 5,000 rows (lat/long coordinates). I would like to perform

[R] Find the closest value in a list or matrix

2008-07-09 Thread R_Learner
I have a long list of numbers [3.4,5.4,3.67,], and I basically want to find the index of the number closest to this number that I have, let's say 5.43. How would I do this without writing a for loop (I have to do this many times for several lists)? Is there a "lookup" function in R? Thanks!

Re: [R] Question regarding lu in package Matrix

2008-07-09 Thread Douglas Bates
On Wed, Jul 9, 2008 at 12:01 PM, Ulrike Grömping <[EMAIL PROTECTED]> wrote: > Dear R-helpers, > I have a question regarding LU-decomposition with function lu in package > Matrix. The following simple example confuses me: Why is as.matrix(elu$U) > not an upper triangular matrix? > u3 <- > matrix(

[R] outlining symbol in legend with blackline

2008-07-09 Thread stephen sefick
# I would like to outline the squares in the legend with a black line. Does anyone know how to do this? x.t <- structure(c(5987.387, 4354.516, 3685.789, 6478.592, 5924.315, NA, 8386, 5559.468, NA, 4651.273, 3967.5, NA, 4339.167, 5053.56, NA, 4631.978, 4808.694, NA, 5217.306, 4017.632, NA, 5846.90

Re: [R] package segmented problem

2008-07-09 Thread milton ruser
Hi Alan How your lm model looks like? Are your data stored on a data.frame ? Case yes, send us a str(df). Send us a short sample of the code and a short subset of the data. Cheers, miltinho astronauta brazil On Tue, Jul 8, 2008 at 5:36 AM, Alan Kelly <[EMAIL PROTECTED]> wrote: > Hi, while usi

Re: [R] Auto.key colors maintained when subsetting

2008-07-09 Thread Deepayan Sarkar
On 7/9/08, David Afshartous <[EMAIL PROTECTED]> wrote: > > > All, > > I'm plotting points and lines for various groups. > I'd like subsequent plots done on subsets to maintain the color assignments > from the original plot. This works fine, but the key for the subset doesn't > maintain the co

Re: [R] Port package

2008-07-09 Thread roger koenker
A little more googling reveals: The Port 3 Library is now available via netlib and licensing arrangements are specified here: http://www.netlib.org/port/readme url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of Economics vox:

Re: [R] Port package

2008-07-09 Thread Katharine Mullen
It is not an R package, but rather a collection of Fortran functions that R uses from netlib: http://www.netlib.org/port/ On Wed, 9 Jul 2008, Jos Kaefer wrote: > Hi > > When I type: > > ?nls > > I come across this section: > > algorithm: character string specifying the algorithm to use. The >

[R] Question regarding lu in package Matrix

2008-07-09 Thread Ulrike Grömping
Dear R-helpers, I have a question regarding LU-decomposition with function lu in package Matrix. The following simple example confuses me: Why is as.matrix(elu$U) not an upper triangular matrix? u3 <- matrix(c(1,1,1,1,1,1,-1,1,0,0,0,0,0,-1,1,0,0,0,-1,0,1,0,0,0,0,0,-1,1,0,0),5,6,byrow=T) elu <- e

Re: [R] Port package

2008-07-09 Thread roger koenker
A more accurate wording, I believe, would be "Port Library" see: http://www.bell-labs.com/project/PORT/ Martin will correct me if there really is a package!! Unfortunately, the licensing link is broken on the URL above and it would be interesting to know what the status of licensing

Re: [R] Strptime/ date time classes

2008-07-09 Thread Mark Difford
Hi Caroline, Because POSIXlt is a complicated structure: you are dealing with a list, not with what you think you are. Maybe this will help you to see more clearly. strptime(19800604062759, format="%Y%m%d%H%M%S") [1] "1980-06-04 06:27:59" str(strptime(19800604062759, format="%Y%m%d%H%M%S")) P

[R] Port package

2008-07-09 Thread Jos Kaefer
Hi When I type: > ?nls I come across this section: algorithm: character string specifying the algorithm to use. The default algorithm is a Gauss-Newton algorithm. Other possible values are '"plinear"' for the Golub-Pereyra algorithm for partially linear least-squar

Re: [R] Parsing

2008-07-09 Thread jim holtman
It might be best to use Perl for this processing since it is better equipped to work with text files of this nature. On Wed, Jul 9, 2008 at 12:18 PM, Paolo Sonego <[EMAIL PROTECTED]> wrote: > I apologize for giving wrong information again ... :-[ > The number of files is not a problem (30/40). T

Re: [R] Parsing

2008-07-09 Thread Paolo Sonego
I apologize for giving wrong information again ... :-[ The number of files is not a problem (30/40). The real deal is that some of my files have ~10^6 lines (file size ~ 300/400M) :'( Thanks again for your help and advices! Regards, Paolo jim holtman ha scritto: How much time is it takin

Re: [R] gsub and "\"

2008-07-09 Thread Ted Harding
On 09-Jul-08 15:49:54, Sean Davis wrote: > This is hopefully a simple question. I am trying to escape single > quotes like so: > > abc's >> abc\'s > > However, I cannot find an easy way to do that with gsub: > > gsub("'","'","abc's") ># returns "abc\\'s" > > How can I get a single \ in t

Re: [R] Strptime/ date time classes

2008-07-09 Thread jim holtman
You probably want POSIXct instead of POSIXlt: x <- read.table(textConnection("#TZUTC+0|*|SANR08002|*|SNAMENAUL|*|SWATERDELVIN|*|CNR98808|*| + #CNAMEQ|*|CTYPEn-min-ip|*|CMW1440|*|RTIMELVLhigh-resolution|*| + #CUNITm3/s|*|RINVAL-777|*|RNR-1|*|REXCHANGE98913|*| + #RTYPEinstantaneous values|*| + 198

Re: [R] gsub and "\"

2008-07-09 Thread Sean Davis
On Wed, Jul 9, 2008 at 11:57 AM, jim holtman <[EMAIL PROTECTED]> wrote: > It does have a single \; the printing just shows that it is escaped. > If you 'cat' it to output, you will see: > > >> gsub("'","'","abc's") > [1] "abc\\'s" >> cat(gsub("'","'","abc's")) > abc\'s > > Which I think is

Re: [R] gsub and "\"

2008-07-09 Thread jim holtman
It does have a single \; the printing just shows that it is escaped. If you 'cat' it to output, you will see: > gsub("'","'","abc's") [1] "abc\\'s" > cat(gsub("'","'","abc's")) abc\'s Which I think is what you were thinking it would be. So when you write it out to a file, it will be cor

Re: [R] Parsing

2008-07-09 Thread jim holtman
How much time is it taking on the files and how many files do you have to process? I tried it with your data duplicated so that I had 57K lines and it took 27 seconds to process. How much faster to you want? On Wed, Jul 9, 2008 at 10:57 AM, Paolo Sonego <[EMAIL PROTECTED]> wrote: > Thanks so muc

  1   2   >