Re: [R] Building Hmisc

2010-04-29 Thread kmithoefer
Hi Kevin, I can't help with your problem. Sorry, but I am interested to learn how you compiled Hmisc package because I need to use it, too. Thank you, Klaus -- View this message in context: http://r.789695.n4.nabble.com/Building-Hmisc-tp2076375p2076530.html Sent from the R help mailing list a

Re: [R] replace elements in a list

2010-04-29 Thread Wincent
Thanks. On 30 April 2010 12:14, Erik Iverson wrote: > Wincent wrote: >> >> Dear all, I have a list like this:  l <- list(list(a=1,b=NULL), >> list(a=2,b=2)) >> I want to find out the elements with value of NULL and replace them with >> NA. >> The actual case has a very long list, so manually find

Re: [R] forecast in arima

2010-04-29 Thread Nestor Arguea
?fitted For instance: xa <- arima(x,order=c(1,1,1)) fitted(xa) Nestor On 04/29/2010 11:30 AM, Julia A wrote: Hello, I have a question about forecast under model arima(1,1,1). I construct this model on 1000 observations and find the forecast for following, for example, 100 observations. But i

Re: [R] replace elements in a list

2010-04-29 Thread Erik Iverson
Wincent wrote: Dear all, I have a list like this: l <- list(list(a=1,b=NULL), list(a=2,b=2)) I want to find out the elements with value of NULL and replace them with NA. The actual case has a very long list, so manually find out and replace them is not an option. I can use for loop to do this, b

Re: [R] model selection, lme

2010-04-29 Thread kMan
Dear Kay, It is not an issue of whether it is "allowed". The issue is understanding what comparisons are taking place between the models. Your advisor should help with that. Perhaps you had a more focused question related to R? Sincerely, KeithC. -Original Message- From: Kay Cichini [ma

[R] Efficient calculation of matrix cumulative standard deviation

2010-04-29 Thread Abiel Reinhart
I am trying to calculate the cumulative standard deviation of a matrix. I want a function that accepts a matrix and returns a matrix of the same size where output cell (i,j) is set to the standard deviation of input column j between rows 1 and i. NAs should be ignored, unless cell (i,j) of the inpu

[R] replace elements in a list

2010-04-29 Thread Wincent
Dear all, I have a list like this: l <- list(list(a=1,b=NULL), list(a=2,b=2)) I want to find out the elements with value of NULL and replace them with NA. The actual case has a very long list, so manually find out and replace them is not an option. I can use for loop to do this, but I want to know

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-29 Thread kMan
Dear Joseph, If you do not need to make any inferences, that is, you just want it to look pretty, then drawing a curve by hand is as good a solution as any. Plus, there is no reason for expert testimony to say that the curve does not mean anything. Sincerely, KeithC. -Original Message-

[R] predict.gbm

2010-04-29 Thread Changbin Du
Hi, Dear Greg, I have one question, if I boosting decision tree, the distribution = "bernoulli", after that, I use predict.gbm to predict the fitted value for new data set. predict(gbm1, newdata, n.trees=best..iteration, type="response") If type="response" then gbm converts back to the same scal

Re: [R] Interaction terms in logistic regression using glm

2010-04-29 Thread Kjetil Halvorsen
see comments below. On Wed, Apr 28, 2010 at 4:29 PM, Andrew Miles wrote: > I recently became aware of the article by Ai and Norton (2003) about how > interaction terms are problematic in nonlinear regression (such as logistic > regression).  They offer a correct way of estimating interaction effe

Re: [R] image function with date-time on X axis

2010-04-29 Thread Peter Ehlers
On 2010-04-29 12:15, Halldór Björnsson wrote: I am trying to plot a image where the x axis has the units of time. When I issue the image(x,y,z) command with x as a POSIXct object, it fails to put a time stamp on the x axis. Instead I get a warning "Incompatible methods" warning and no dates on m

Re: [R] understanding behavior of "merge"

2010-04-29 Thread David Winsemius
On Apr 29, 2010, at 7:26 PM, Chris__ Barker wrote: I'm trying to bootstrap resample from a repeated measures dataset. I sample a vector of "ID"'s from my dataframe with replacement. Then I merge this back with my dataframe. I'm re-sampling subjects in the dataset rather than rows of the data.

[R] apply vs. foreach vs. foreach with doSMP (multi cores)

2010-04-29 Thread Tao Shi
Hi David and list, I'm a little puzzled to see these results below.  Since, "apply" is basically a for loop, I was expecting "foreach" uses about same amount of time as apply, whereas foreach after registering 2-cores runs much faster.  However, the results show apply is the fastest.  Also

Re: [R] can not print probabilities in svm of e1071

2010-04-29 Thread Changbin Du
HI, Saeed, It worked this time. Thanks, I appreciated it very much! On Thu, Apr 29, 2010 at 5:23 PM, Saeed Abu Nimeh wrote: > in svm.roc <- prediction(attributes(svm.pred)$decision.values, valid) > valid should be the output variable in the validation set. maybe > valid[,1] assuming that it

Re: [R] Lattice Groups

2010-04-29 Thread Santosh
Richard, Thanks for your email. I am not looking for that kind of plot as you had suggested. I would like to see overlaid boxplots. Deepayan had earlier shown the method of overlay of boxplots (using panel.groups=panel.bwplot)... I have seen in some packages like ggplot2, where the overlapped plot

Re: [R] any feedback on XL Solutions Courses for R?

2010-04-29 Thread Dimitri Liakhovitski
I can only provide feedback on one and only course I participated in. It was 3 years ago. It was for R beginners. And I guess, we did not get lucky - the person who was sent was not a good instructor. Our boss at the company I was working for at the time (who is very good with R) ended up answering

[R] how is xerror calculated in rpart?

2010-04-29 Thread Seth
Hi, I've searched online, in a few books, and in the archives, but haven't seen this. I believe that xerror is scaled to rel error on the first split. After fitting an rpart object, is it possible with a little math to determine the percentage of true classifications represented by a xerror val

Re: [R] dopar parallel assignments

2010-04-29 Thread Vivek Ayer
Hi David, Thanks for the help. It's working! I still find it to be a new concept. I haven't encountered storing loops in objects in any other languages. Can it even be done in other languages? Very novel, quite intriguing. Thanks again, Vivek On Thu, Apr 29, 2010 at 3:44 PM, David M Smith wrote

Re: [R] can not print probabilities in svm of e1071

2010-04-29 Thread Changbin Du
HI, Saeed, Thanks so much for the help, I run your code and found the following problem, do you have any comments or suggestions? > svm.p<-svm(as.factor(out) ~ ., data=train[,c( 2:18, 20:21, 24, 27:32)], probability=TRUE, method="C-classification", + kernel="radial", cost=bestc, gamma=bestg, cros

[R] Building Hmisc

2010-04-29 Thread rkevinburton
>From the notes I see that for 2.11 Hmisc is not supported and the suggestion >is made to build from source. I am on a Windows 7 platform and I got all of >the tools and successfully built 'R' from source. I changed to gnuwin32 and >entered make all recommended. Even though the tar.gz (source) v

Re: [R] can not print probabilities in svm of e1071

2010-04-29 Thread Saeed Abu Nimeh
svm.model <- svm(y~.,data=dataset,probability=TRUE) svm.pred<-predict(svm.model, test.set, decision.values = TRUE, probability = TRUE) library(ROCR) svm.roc <- prediction(attributes(svm.pred)$decision.values, test.set) svm.auc <- performance(svm.roc, 'tpr', 'fpr') plot(svm.auc) On Thu, Apr

[R] Periodic regression - lunar percent cover

2010-04-29 Thread Tim Clark
Dear List, I am trying include a lunar variable in a model and am having problems figuring out the correct way to include it. I want to convert the percent lunar illumination (fraction of moon showing) to a combination of sin and cos variables to account for the periodic nature of the lunar cy

Re: [R] reduce size of pdf

2010-04-29 Thread Nevil Amos
The file is a large number of scatterplot matrices (120pp of 4x4 matrix) the individual plots may have up to several hudred points. I am already using the "useDingbats" but the files are still very large - I can reduce them about 50% in cute.pdf by changing the dpi setting but it would be go

Re: [R] control span in panel.loess in xyplot

2010-04-29 Thread Felix Andrews
Within panel.superpose, the current group number is passed as "group.number" to the "panel.groups" function. On 29 April 2010 20:39, Gabor Grothendieck wrote: > See ?panel.number for lattice functions that can be used in your panel > function to discover which one is currently being drawn. > > O

[R] understanding behavior of "merge"

2010-04-29 Thread Chris__ Barker
I'm trying to bootstrap resample from a repeated measures dataset. I sample a vector of "ID"'s from my dataframe with replacement. Then I merge this back with my dataframe. I'm re-sampling subjects in the dataset rather than rows of the data. I thought I could use the left/right join features of t

Re: [R] Can't load "doSMP" from REvolutionR in regular R2.11.0

2010-04-29 Thread Tal Galili
Hi Tao, Thanks for the file - it works great for me. Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (Englis

Re: [R] Can't load "doSMP" from REvolutionR in regular R2.11.0

2010-04-29 Thread Tao Shi
Thanks, David!  I forgot to check that email... I have built the revoIPC using R2.11.0 and it seemed there were no error messages.  I can load doSMP now, but haven't tested it yet. Tal, I'll send you the file offline, so you can also test it. best! ...Tao -

[R] can not print probabilities in svm of e1071

2010-04-29 Thread Changbin Du
> x <- train[,c( 2:18, 20:21, 24, 27:31)] > y <- train$out > > svm.pr <- svm(x, y, probability = TRUE, method="C-classification", kernel="radial", cost=bestc, gamma=bestg, cross=10) > > pred <- predict(svm.pr, valid[,c( 2:18, 20:21, 24, 27:31)], decision.values = TRUE, probability = TRUE) > at

Re: [R] Upgrade process for libraries: can I use installed.packages on an old installation followed by install.packages in a new one

2010-04-29 Thread Gabor Grothendieck
Correction On Thu, Apr 29, 2010 at 6:28 PM, Gabor Grothendieck wrote: > The batchfiles distribution has a copydir.bat which copies files from > one directory to another without overwriting anything and a > movedir.bat which is similar but moves the files rather than copying > them (which is much

Re: [R] a question on autocorrelation acf

2010-04-29 Thread Duncan Murdoch
On 29/04/2010 6:22 PM, zhenjiang xu wrote: Hi R users, where can I find the equations used by acf function to calculate autocorrelation? See the reference listed in ?acf. Duncan Murdoch I think I misunderstand acf. Doesn't acf use following equation to calculate autocorrelation? [image: R(

Re: [R] dopar parallel assignments

2010-04-29 Thread David M Smith
[This relates to the foreach function in library(foreach)] Vivek, In the %dopar% example, the assignments are being made into "child" R sessions in parallel. foreach is generally pretty good about detecting variables you reference in the parallel loops and making sure the objects are copied over

Re: [R] Upgrade process for libraries: can I use installed.packages on an old installation followed by install.packages in a new one

2010-04-29 Thread Gabor Grothendieck
The batchfiles distribution has a copydir.bat which copies files from one directory to another without overwriting anything and a movedir.bat which is similar but moves the files rather than copying them (which is much faster but you wont have the packages in your old installation any more). Get t

[R] a question on autocorrelation acf

2010-04-29 Thread zhenjiang xu
Hi R users, where can I find the equations used by acf function to calculate autocorrelation? I think I misunderstand acf. Doesn't acf use following equation to calculate autocorrelation? [image: R(\tau) = \frac{\operatorname{E}[(X_t - \mu)(X_{t+\tau} - \mu)]}{\sigma^2}\, ,] If it does, then the a

Re: [R] Upgrade process for libraries: can I use installed.packages on an old installation followed by install.packages in a new one

2010-04-29 Thread Ted Byers
When doing a fresh install of a new version of R, using update.packages() requires copying some of the contents of the library subdirectory to the new installation. While possible and viable, it can be problematic in being tedious (more an irritation regarding how Windows handles copying directori

Re: [R] dopar parallel assignments

2010-04-29 Thread Erik Iverson
Vivek Ayer wrote: Hi guys, I was wondering why this piece of code doesn't work: foreach (i = c(1.25,1.50)) %dopar% { assign(paste("test_",i,sep=""),i) } but, this does: foreach (i = c(1.25,1.50)) %do% { assign(paste("test_",i,sep=""),i) } ... and which package are these functions in? __

Re: [R] Is it possible to transform a factor to a number like this way?

2010-04-29 Thread Erik Iverson
song song wrote: such a factor as a=as.factor(c(1.23, 4.56, 7.89)) and I want to get this vector: c(1.23, 4.56, 7.89). You're told how to do this in the help page for ?factor. See the Warning section. __ R-help@r-project.org mailing list http

[R] dopar parallel assignments

2010-04-29 Thread Vivek Ayer
Hi guys, I was wondering why this piece of code doesn't work: foreach (i = c(1.25,1.50)) %dopar% { assign(paste("test_",i,sep=""),i) } but, this does: foreach (i = c(1.25,1.50)) %do% { assign(paste("test_",i,sep=""),i) } Obviously, the difference is %dopar% vs. %do%. If I use %do%, I get objec

[R] Is it possible to transform a factor to a number like this way?

2010-04-29 Thread song song
such a factor as a=as.factor(c(1.23, 4.56, 7.89)) and I want to get this vector: c(1.23, 4.56, 7.89). Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] any feedback on XL Solutions Courses for R?

2010-04-29 Thread Josef . Kardos
About a week ago, XL Solutions Corporation posted to this list with a solicitation for course offerings in R. I looked at their site, and many courses do look interesting. Can anyone provide feedback on the quality of their courses? [[alternative HTML version deleted]]

Re: [R] Upgrade process for libraries: can I use installed.packages on an old installation followed by install.packages in a new one

2010-04-29 Thread Erik Iverson
Ted Byers wrote: I tend to have a lot of packages installed, in part because of a wide diversity of interests and a disposition of examining different ways to accomplish a given task. I am looking for a better way to upgrade all my packages when I upgrade the version of R that I am running. O

Re: [R] Lattice Groups

2010-04-29 Thread RICHARD M. HEIBERGER
Santosh, continuing with your example, I recommend several functions in the HH package. ## install.packages("HH") ## needed once, if you don't already have it require(HH) tmp <- data.frame(y=rnorm(100), category=rep(factor(letters[1:5]), each=20), level=rep(f

[R] Upgrade process for libraries: can I use installed.packages on an old installation followed by install.packages in a new one

2010-04-29 Thread Ted Byers
I tend to have a lot of packages installed, in part because of a wide diversity of interests and a disposition of examining different ways to accomplish a given task. I am looking for a better way to upgrade all my packages when I upgrade the version of R that I am running. On looking at support

Re: [R] reduce size of pdf

2010-04-29 Thread Paul Hiemsta
Nevil Amos wrote: is there a way to reduce the size of pdf files in R: ? compression? lower dpi ? or some other option? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-

Re: [R] Errors when trying to open odfWeave documents

2010-04-29 Thread Paul
Paul wrote: > Hello > > I tried the odfWeave package today, by running the formatting.odt and > example.odt files that are included with the package. > > They both ran fine, but when I try to open them in my OpenOffice > (OpenOffice 3.1.1 on Kubuntu 9.10) I get an error "Format error > discovere

Re: [R] coda sweave

2010-04-29 Thread Randall Wrong
Thank you Bryan 2010/4/27 Brian Diggs > On 4/27/2010 1:42 PM, Randall Wrong wrote: > >> Thank you so much Ista. >> >> I have problems with pictures too. >> >> \begin{figure} >> \centering >> <>= >> xyplot( mcmc(x) ) >> @ >> \end{figure} >> >> Why doesn't this work ? Sorry for posting all these q

Re: [R] data.table error

2010-04-29 Thread David Winsemius
On Apr 29, 2010, at 3:49 PM, johannes rara wrote: Thanks for the quick response. I tried to install from R-Forge but it seems that data.table is not currently available? install.packages("data.table",repos="http://R-Forge.R-project.org";) Warning: unable to access index for repository http:/

[R] How to estimate the residual SD for each sample separately in mixed-effects model?

2010-04-29 Thread Michal Figurski
Dear R-helpers, I am developing a Mixed-Effects model for a study of immunoassays using 'lme4' library. The study design is as follows: 10 samples were run using 7 different immunoassays, 3 times each, in duplicates. Data attached. I have developed the following model: c.lme <- lmer(Result~S

Re: [R] Can't load "doSMP" from REvolutionR in regular R2.11.0

2010-04-29 Thread David M Smith
Did you download the source bundle when you downloaded REvolution R? You'll find them there. There's a link in the same email that gives instructions for downloading the binaries. # David Smith On Thu, Apr 29, 2010 at 12:48 PM, Tao Shi wrote: > > Hi David, > > Thank you for the reply!  Do you kn

Re: [R] data.table error

2010-04-29 Thread johannes rara
Thanks, it worked, and the error message disappeared... * installing *source* package ‘data.table’ ... ** libs ** arch - i386 gcc -arch i386 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/i386 -I/usr/local/include-fPIC -g -O2

Re: [R] Can't load "doSMP" from REvolutionR in regular R2.11.0

2010-04-29 Thread Tao Shi
Hi David, Thank you for the reply!  Do you know where I can find the source code for these packages?  I can give it a try. ...Tao > From: da...@revolution-computing.com > Date: Thu, 29 Apr 2010 08:59:08 -0700 > Subject: Re: [R] Can't load "doSMP" from

Re: [R] data.table error

2010-04-29 Thread johannes rara
Thanks for the quick response. I tried to install from R-Forge but it seems that data.table is not currently available? > install.packages("data.table",repos="http://R-Forge.R-project.org";) Warning: unable to access index for repository http://R-Forge.R-project.org/bin/macosx/universal/contrib/2.

Re: [R] data.table error

2010-04-29 Thread Tom Short
Johannes, please try the latest version on R-forge (1.4). That error has been fixed, and it's much faster. We hope to have that to CRAN reasonably soon. To install, use: install.packages("data.table",repos="http://R-Forge.R-project.org";) - Tom Tom Short On Thu, Apr 29, 2010 at 3:40 PM, joha

[R] competing risk analysis

2010-04-29 Thread paaventhan jeyaganth
Deart All, I am doing competing risk analysis, I am tring store the estimate value in bbb but it gives error, it's anybody knows how to store in estimated value. Thanks Paaveen xx <- cuminc(wkdt$fu.year, wkdt$status) bbb <- cuminc.est(xx,F) Error in cuminc.est: Argument number 2 no

[R] data.table error

2010-04-29 Thread johannes rara
I'm trying to learn data.table package but I get a following annoying error message: > install.packages("data.table") trying URL 'http://www.freestatistics.org/cran/bin/macosx/universal/contrib/2.10/data.table_1.2.tgz' Content type 'application/x-gzip' length 66823 bytes (65 Kb) opened URL ==

Re: [R] 2D look up (within interval)

2010-04-29 Thread David Winsemius
On Apr 29, 2010, at 1:58 PM, YasirKaheil wrote: Hi, I have a matrix of X and Y coordinates, and one pair of coordinates that I need to know it corresponds (or is closest) to which row in the matrix. For example: MC<- cbind(rep(1:1000,each=1000),rep(1:1000,1000)); p<-c(543.1,440.05); I know

Re: [R] dump not evaluating promises?

2010-04-29 Thread D Sonderegger
What I was expecting was for the second dump was: foo <- structure(c(1,2,3,4,5,6), .Dim = c(2L, 3L)) That is, I was expecting dump to expand the 1:6 and 2:3 into the actual vectors. -- View this message in context: http://r.789695.n4.nabble.com/dump-not-evaluating-promises-tp2075859p2076059.

Re: [R] BB package

2010-04-29 Thread Berend Hasselman
Roslina Zakaria wrote: > > Hi I would like to solve a system of nonlinear equations below using > dfsane function >   > mn <- 142.36; vr <- 9335.69 ; sk <- 0.81;  kur <- 0.25 > test_fn <- function(p) > {    f <- rep(NA, length(p)) >   >   f[1] <- p[1]*(p [2]+p[3])- mn >   f[2] <- - vr + 2*p[1]

Re: [R] dump not evaluating promises?

2010-04-29 Thread Duncan Murdoch
On 29/04/2010 12:45 PM, D Sonderegger wrote: I'm using the dump command to pass data to WinBUGS/OpenBUGS/JAGS and have run into a problem. Here is some R-code: foo <- array(1:6, dim=c(2,3)) dump('foo', file='dumpdata.R') dump('foo', file='dumpdata.R', append=TRUE, evaluate=TRUE) foo2 <- array(c(

[R] Rotating Titles

2010-04-29 Thread Wiltse
Hi All, I am looking for help in rotating species titles produced using the strat.plot( ) function in the rioja package. This function produces a stratigraphic plot of paleoenvironmental data. Currently the titles of each species are plotted vertically while they are typically plotted at a 45 d

[R] Rotating Titles

2010-04-29 Thread Brendan Wiltse
Hi All, I am looking for help in rotating species titles produced using the strat.plot( ) function in the rioja package. This function produces a stratigraphic plot of paleoenvironmental data. Currently the titles of each species are plotted vertically while they are typically plotted at a 45 de

[R] 2D look up (within interval)

2010-04-29 Thread YasirKaheil
Hi, I have a matrix of X and Y coordinates, and one pair of coordinates that I need to know it corresponds (or is closest) to which row in the matrix. For example: MC<- cbind(rep(1:1000,each=1000),rep(1:1000,1000)); p<-c(543.1,440.05); I know that if you do which.min you'll get the answer, which

[R] image function with date-time on X axis

2010-04-29 Thread Halldór Björnsson
I am trying to plot a image where the x axis has the units of time. When I issue the image(x,y,z) command with x as a POSIXct object, it fails to put a time stamp on the x axis. Instead I get a warning "Incompatible methods" warning and no dates on my x axis. This example shows my problem: Rmat=

Re: [R] substring comparison

2010-04-29 Thread Claus O'Rourke
Thanks. It works perfectly. On Thu, Apr 29, 2010 at 6:24 PM, Henrique Dallazuanna wrote: > Try with grepl: > > data$ContainsThe <- ifelse(grepl("the",data$Utt),"y","n") > > On Thu, Apr 29, 2010 at 2:17 PM, Claus O'Rourke > wrote: >> >> Hi all, >> >> I'm writing a script to do some basic text ana

Re: [R] Simple loop code

2010-04-29 Thread David Winsemius
On Apr 29, 2010, at 1:42 PM, Henrique Dallazuanna wrote: On Thu, Apr 29, 2010 at 12:05 PM, David Winsemius > wrote: snipped ##Then bind to your data z <- cbind(y,x) Oooh. Not a good practice, at least for the newish useR. cbind and rbind create matrices and as a consequence coerce a

Re: [R] Simple loop code

2010-04-29 Thread Henrique Dallazuanna
On Thu, Apr 29, 2010 at 12:05 PM, David Winsemius wrote: > > On Apr 29, 2010, at 10:37 AM, RCulloch wrote: > > >> Thanks Henrique, >> >> that works! for anyone else as slow as me, just: >> >> ##Assign >> x <- factor(dat.ID$ID2, labels = 1:7) >> ##Convert to dataframe >> x <- as.data.frame(x) >> >

Re: [R] How to extract data table

2010-04-29 Thread Tengfei Yin
Hi Maybe ?write.table ?write.csv ?dput On Thu, Apr 29, 2010 at 10:55 AM, ericyujin99 wrote: > > I'm a very new user of R, > The problem I got is when I have lots of data table, 3 columns and 100 rows > assigned to a variable x. > how can I transform the table into a external file excel or othe

Re: [R] substring comparison

2010-04-29 Thread Henrique Dallazuanna
Try with grepl: data$ContainsThe <- ifelse(grepl("the",data$Utt),"y","n") On Thu, Apr 29, 2010 at 2:17 PM, Claus O'Rourke wrote: > Hi all, > > I'm writing a script to do some basic text analysis in R. Let's assume > I have a data frame named data which contains a column named 'utt' > which conta

Re: [R] substring comparison

2010-04-29 Thread David Winsemius
On Apr 29, 2010, at 1:17 PM, Claus O'Rourke wrote: Hi all, I'm writing a script to do some basic text analysis in R. Let's assume I have a data frame named data which contains a column named 'utt' which contains strings. Is there a straightforward way to achieve something like this: data$Cont

[R] substring comparison

2010-04-29 Thread Claus O'Rourke
Hi all, I'm writing a script to do some basic text analysis in R. Let's assume I have a data frame named data which contains a column named 'utt' which contains strings. Is there a straightforward way to achieve something like this: data$ContainsThe <- ifelse(startsWith(data$Utt,"the"),"y","n")

[R] RandomForest diagnostics plot

2010-04-29 Thread Changbin Du
HI, Andy, ON the RandomForest diagnostics plot, three lines were drawn. ON the help document of plot.randomForest, only the error rate and MSE are described. I dont know which line is which? Can you help me with that? Thanks so much! -- Sincerely, Changbin -- [[alternative HTML ver

Re: [R] how to parse out fitting statistics and write them into a data frame?

2010-04-29 Thread D Sonderegger
> however, the result is a list and i do not know whether more model fitting > statistics (like p value of t test) is included in "result" or not. If i > print the first element of resut i got the followings: > The structure command is extremely helpful here. > str(result) will give you all t

Re: [R] getting random integers

2010-04-29 Thread Erik Iverson
Hans Ekbrand wrote: I want 100 integers. Each integer, x, can be in the range 1 =< x => 10. Does the following code give 1 and 10 the same chances to be selected as 2:8? round(runif(100, min = 1, max = 10)) If you just want to sample integers, use ?sample __

[R] dump not evaluating promises?

2010-04-29 Thread D Sonderegger
I'm using the dump command to pass data to WinBUGS/OpenBUGS/JAGS and have run into a problem. Here is some R-code: foo <- array(1:6, dim=c(2,3)) dump('foo', file='dumpdata.R') dump('foo', file='dumpdata.R', append=TRUE, evaluate=TRUE) foo2 <- array(c(2,3,5,7,9,7,5,3), dim=c(2,4)) dump('foo2', fil

Re: [R] getting random integers

2010-04-29 Thread Sarah Goslee
You can always take a look. If you use a much bigger sample size it will be obvious: hist(round(runif(100, min = 1, max = 10))) I'd use instead: hist(sample(1:10, 100, replace=TRUE)) Sarah On Thu, Apr 29, 2010 at 12:39 PM, Hans Ekbrand wrote: > I want 100 integers. Each integer, x,

[R] forecast in arima

2010-04-29 Thread Julia A
Hello, I have a question about forecast under model arima(1,1,1). I construct this model on 1000 observations and find the forecast for following, for example, 100 observations. But it' s necessary for me to get the predicted values of the previous 100 observations and compare it with actual value

[R] getting random integers

2010-04-29 Thread Hans Ekbrand
I want 100 integers. Each integer, x, can be in the range 1 =< x => 10. Does the following code give 1 and 10 the same chances to be selected as 2:8? round(runif(100, min = 1, max = 10)) -- Hans Ekbrand signature.asc Description: Digital signature __

Re: [R] generating correlated random variables from different distributions

2010-04-29 Thread Greg Snow
The method you are using (multiply by cholesky) works for normal distributions, but not necessarily for others (if you want different means/sd, then add/multiply after transforming). For other distributions this process can sometimes give the correlation you want, but may change the variable(s)

Re: [R] operator problem within function

2010-04-29 Thread David Winsemius
That was copied from the help page the comes up with: ?"$" It is rather "special". -- David. On Apr 29, 2010, at 12:26 PM, Bunny, lautloscrew.com wrote: Nice, thx. Which manual do you use ? an introduction to R ? Or something special ? matt On 29.04.2010, at 15:25, David Winsemius w

[R] how to parse out fitting statistics and write them into a data frame?

2010-04-29 Thread weix1
hello, everyone: I am conducting t test between drug and control for about 50,000 gene using the following syntax (treatment is factor): result<- lapply(split(data, data$gene),function(x) lm(value~treatment,x) however, the result is a list and i do not know whether more model fitting statis

Re: [R] operator problem within function

2010-04-29 Thread Bunny, lautloscrew.com
Nice, thx. Which manual do you use ? an introduction to R ? Or something special ? matt On 29.04.2010, at 15:25, David Winsemius wrote: > > On Apr 29, 2010, at 9:03 AM, Bunny, lautloscrew.com wrote: > >> Sorry for that offlist post, did not mean to do it intentionally. just hit >> the wrong

Re: [R] Split a vector by NA's - is there a better solution then a loop ?

2010-04-29 Thread Thomas Stewart
Or, you can modify Romain's function to account for sequential NAs. x <- c(1,2,NA,1,1,2,NA,NA,4,5,2,3) foo <- function( x ){ idx <- 1 + cumsum( is.na( x ) ) not.na <- ! is.na( x ) f<-factor(idx[not.na],levels=1:max(idx)) split( x[not.na], f ) } $`1` [1] 1 2 $`2` [1] 1 1 2 $`3` nu

[R] How to extract data table

2010-04-29 Thread ericyujin99
I'm a very new user of R, The problem I got is when I have lots of data table, 3 columns and 100 rows assigned to a variable x. how can I transform the table into a external file excel or other files without losing any information. So that make the data look nicer. -- View this message in contex

Re: [R] reduce size of pdf

2010-04-29 Thread Greg Snow
It would help if we knew how big your pdf is and why it is big. Can you show an example or at least describe the process used to generate the file and what you goals are in creating/displaying the file? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@

Re: [R] merged files

2010-04-29 Thread David Winsemius
On Apr 29, 2010, at 10:21 AM, Alex Jameson wrote: Hi, i have two files (file1.txt and file2.txt) which i would like to merge, based on certain criteria, i.e. it combines data based on matching geneID and exons. i have used the merge option, Huh? What is the merge option? (There is a merge

Re: [R] Using plyr::dply more (memory) efficiently?

2010-04-29 Thread Steve Lianoglou
Hi Matthew, > Sounds like its working,  but could you give us an idea whether it is quick > and memory efficient ? I actually can't believe what I'm seeing, I just recoded the function to use data.table. What has taken something on the order of ~ 20-30mins with an lapply/do.call(rbind, ...) comb

Re: [R] Can't load "doSMP" from REvolutionR in regular R2.11.0

2010-04-29 Thread David M Smith
We haven't tested doSMP with the mingw compiler (hence why we haven't yet submitted it to CRAN). We compiled it under R 2.10 using the same Intel compilers we use for REvolution R. It is open source (GPL) so you're welcome to try compiling it under mingw yourself, but we can't offer support for tha

Re: [R] Using plyr::dply more (memory) efficiently?

2010-04-29 Thread Matthew Dowle
"Steve Lianoglou" wrote in message news:t2ybbdc7ed01004290812n433515b5vb15b49c170f5a...@mail.gmail.com... > Thanks for directing me to the data.table package. I read through some > of the vignettes, and it looks quite nice. > > While your sample code would provide answer if I wanted to just > c

Re: [R] variable importance in Random Forest

2010-04-29 Thread Changbin Du
HI, Andy, Thanks so much for your reply! IN the paper "Classification and regression by randomForest", the first page, there is "the random forest estimate the the importance of a variable by looking at how much prediction error increase when the variable is permuted..." IN the help document of

[R] reduce size of pdf

2010-04-29 Thread Nevil Amos
is there a way to reduce the size of pdf files in R: ? compression? lower dpi ? or some other option? __ 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-

Re: [R] Generalized Estimating Equation (GEE): Why is Link = Identity?

2010-04-29 Thread Thomas Stewart
>From the GEE article in R News, Vol. 2/3, December 2002: "Allows different covariates in separate models for the mean, scale, and correlation via various link functions." Geepack offers link functions for the scale, correlation, and mean models. As the output suggests, "Correlation: Structure

Re: [R] Multiple cex sizes in main for xyplot?

2010-04-29 Thread Bert Gunter
Felix: Oh, yes. That gives me what I want without having to resort to padding parameters. I don't know why it works (vs specifying the y locations), but I suppose that's confounded with the details of lattice engineering, which I wanted to avoid. So many thanks for your help. Bert Gunter Genent

Re: [R] time zone convert

2010-04-29 Thread David Winsemius
On Apr 29, 2010, at 10:14 AM, Carol Gao wrote: Appreciate it! I was trying on the code you sent, then some error codes turned up: The first line runs ok, the second line: modifyList(Time2, list(hour = Time2$hour + 11)) Error in Time2$hour : $ operator is invalid for atomic vectors The ti

[R] Odp: convert Factor as numeric

2010-04-29 Thread Petr PIKAL
Hi You have to get rid of thousands separator firsr as.numeric(gsub(",", "", S)) Regards Petr r-help-boun...@r-project.org napsal dne 29.04.2010 13:12:44: > Dear group, > > I know this issue has been already covered, and before you reply I must say > I have read the R-FAQ and search the mail

Re: [R] time zone convert

2010-04-29 Thread Carol Gao
Thanks! I think it now works after I changed the time zone and language settings on PC. It seems when the system was under some other languages other than english, it reads the time a bit differently. Not sure if it was the reason, but thanks for your help. Cheers, Carol On Fri, Apr 30, 2010 at

[R] Tinn-R related problem

2010-04-29 Thread Maspfuhl, Oliver
Dear Mr Hewitt, I am having exactly the same problem as descibed on page https://stat.ethz.ch/pipermail/r-help/2008-March/156809.html (please find a copy below), I wonder if you happen to have heart of any solution to it (i.e. which Windows settings have to be altered in order to solve the pr

Re: [R] merged files

2010-04-29 Thread Alex Jameson
Hi, i have two files (file1.txt and file2.txt) which i would like to merge, based on certain criteria, i.e. it combines data based on matching geneID and exons. i have used the merge option, but it does not give me the desired outcome. merged.txt shows the result i would like. *File1. txt* **

Re: [R] Split a vector by NA's - is there a better solution then a loop ?

2010-04-29 Thread Charles C. Berry
On Thu, 29 Apr 2010, Barry Rowlingson wrote: On Thu, Apr 29, 2010 at 1:27 PM, Henrique Dallazuanna wrote: Another option could be: split(x, replace(cumsum(is.na(x)), is.na(x), -1))[-1] One thing none of the solutions so far do (except I haven't tried Tal's original code) is insert an empty

[R] generating correlated random variables from different distributions

2010-04-29 Thread Richard and Barbara Males
I need to generate a set of correlated random variables for a Monte Carlo simulation. The solutions I have found (http://www.stat.uiuc.edu/stat428/cndata.html, http://www.sitmo.com/doc/Generating_Correlated_Random_Numbers), using Cholesky Decomposition, seem to work only if the variables come fro

[R] Fidelity of lattice graphics captured to jpeg or png... followup

2010-04-29 Thread Rob James
Subsequent investigations (via GIMP) show that the problem is in OO, and now with the images themselves. Off to the OO forums. Original Message Subject:Fidelity of lattice graphics captured to jpeg or png Date: Thu, 29 Apr 2010 08:05:04 -0700 From: Rob James To:

Re: [R] Using plyr::dply more (memory) efficiently?

2010-04-29 Thread Steve Lianoglou
Hi Matthew, On Thu, Apr 29, 2010 at 9:52 AM, Matthew Dowle wrote: > I don't know about that,  but try this : > > install.packages("data.table", repos="http://R-Forge.R-project.org";) > require(data.table) > summaries = data.table(summaries) > summaries[,sum(counts),by=symbol] > > Please let us kn

  1   2   >