Re: [R] escape character OK in R environment, fails in R CMD CHECK

2010-05-21 Thread Henrik Bengtsson
R version/sessionInfo()? /H On Fri, May 21, 2010 at 10:08 PM, David Reiss wrote: > Hi, > I am trying to check a package via R CMD CHECK and it is failing with > > Error: '\s' is an unrecognized escape in character string starting "\s" > > The culprit looks something like this: > > gsub('\\s\\(.*

Re: [R] Increasing the maximum number of rows

2010-05-21 Thread Erik Iverson
Alex Ruiz E. wrote: Dear R helpers, I created a somewhat big database (+206,700 rows) in MySQL and have exported into a csv file, but I can't open the whole thing in R. I am using: base<-read.csv("/path/to/file.csv", header=F, sep="," nrows=206720) R doesn't complain but it only opens 128,32

[R] Increasing the maximum number of rows

2010-05-21 Thread Alex Ruiz E.
Dear R helpers, I created a somewhat big database (+206,700 rows) in MySQL and have exported into a csv file, but I can't open the whole thing in R. I am using: > base<-read.csv("/path/to/file.csv", header=F, sep="," nrows=206720) R doesn't complain but it only opens 128,328 observations (the nu

Re: [R] Levelplot

2010-05-21 Thread Peter Ehlers
On 2010-05-21 11:36, apjawor...@mmm.com wrote: I am not sure if I am correct but I think the labels argument pertains only to the counterplot function. It's true that the 'labels' argument is only used in contourplot, not levelplot. Moreover, there is an example of the use of levelplot on the h

Re: [R] Concatenation

2010-05-21 Thread santana sarma
Many thanks - the problem is solved. Didn't realize that it was indeed simple. Thanks again. Cheers, [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the post

Re: [R] Error in FUN(X[[1L]], ...) : STRING_ELT() can only be applied to a 'character vector', not a 'integer'

2010-05-21 Thread Erik Iverson
Hello, PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. We don't know the function you're using or the data you applied the function to, which makes it almost impossible to help. Can you use ?dput to

[R] Error in FUN(X[[1L]], ...) : STRING_ELT() can only be applied to a 'character vector', not a 'integer'

2010-05-21 Thread sedm1000
I am receiving this error running a command on a multi-row data-frame. The data is strings of text (each with new line separator, no spaces, no numerical characters). Error in FUN(X[[1L]], ...) : STRING_ELT() can only be applied to a 'character vector', not a 'integer' I can run single text str

Re: [R] Reading in and writing out one line at a time

2010-05-21 Thread sedm1000
Hi, Thanks for you insight. the problem that I have is that the program reports back an error: Error in FUN(X[[1L]], ...) : STRING_ELT() can only be applied to a 'character vector', not a 'integer When I try to read in a multi-row frame, and so I can only feed in one row at a time. The data

[R] Creating the Firefox Download Analytics Map in R

2010-05-21 Thread Jason Rupert
By any chance has anyone put together the R code for reproducing the Firefox Downloads Analytics Map in R? Here is a link to an example: http://www.knitwareblog.com/wp-content/uploads/2008/06/firefox-3-download-map.jpg I'll try to track down the inputs, but I am interested in putting the code

Re: [R] Getting sink to work with "message" on R 2.11.0 - what did I miss?

2010-05-21 Thread Bert Gunter
I probably shouldn't be replying, as I believe this may require system specific tricks that I don't know. To that end, you should probably provide the minimum required information (e.g. from sessionInfo() + any other OS/shell info) requested by the posting guide. AFAIK, this can't be done in R. Th

Re: [R] predict

2010-05-21 Thread Phil Spector
Try this: mydata = as.data.frame(cbind(PrinComp[,1:5],x1=X[,1])) net5 = lm(x1~.,data=mydata) y=predict(net5, newdata=data.frame(PrinCompPredict)[,1:5]) (I can't test it, since you didn't provide a reproducible example.) Basically your problem is that when you pass a *matrix* to the modeling fun

Re: [R] Getting sink to work with "message" on R 2.11.0 - what did I miss?

2010-05-21 Thread David Winsemius
On May 21, 2010, at 5:34 PM, Greg Snow wrote: Look at txtStart and friends in the TeachingDemos package as an alternative to sink that includes commands as well as output. Know the quality of Greg Snows work it will probably be better than mine, but perhaps: > capfn <- function(inp) { +

[R] predict

2010-05-21 Thread Luis Felipe Parra
Hello I am creating a linear model with the command net5 = lm( X[,1] ~ PrinComp[,1:5]) where my vector PrinComp looks like this > head(PrinComp[,1:5]) PC1 PC2PC3PC4PC5 [1,] 1.8626055 -3.34190998 -0.5448889 2.8296751 0.3994096 [2,] 3.1124144 -1.68113572

Re: [R] Getting sink to work with "message" on R 2.11.0 - what did I miss?

2010-05-21 Thread Greg Snow
Look at txtStart and friends in the TeachingDemos package as an alternative to sink that includes commands as well as output. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-

Re: [R] i have question about ARMAX

2010-05-21 Thread David Winsemius
On May 21, 2010, at 1:40 PM, Mohamed Abdelaziem Ibrahim wrote: Pro, I am PhD student , i am usuing Rational Expectations Model, I want to model different timeseries with ARMAX models in R because I think that ARMAX models will map best to these data. I want know the steps to use R for A

Re: [R] Getting sink to work with “message” on R 2.11.0 - what did I miss?

2010-05-21 Thread Tal Galili
Hi David, I want to get both the 4 and the "1+3" that created it. I am trying to help someone else on the mailing list that is looking for a way to "sink" the console into word, so he could have word read it to him (he is blind). I know how to do the second part, but the first part (using sink wi

Re: [R] Getting sink to work with “message” on R 2.11.0 - what did I miss?

2010-05-21 Thread David Winsemius
On May 21, 2010, at 5:02 PM, Tal Galili wrote: Hi all, I am trying to use type message with sink, like this: sink("all.Rout", type="message") 1+3 sink() readLines(con = "all.Rout") So to get the following output: 1+3 [1] 4 Obviously this doesn't work. What are you trying to do? The

[R] Getting sink to work with “message” on R 2.11.0 - what did I miss?

2010-05-21 Thread Tal Galili
Hi all, I am trying to use type message with sink, like this: sink("all.Rout", type="message") 1+3 sink() readLines(con = "all.Rout") So to get the following output: > 1+3 [1] 4 Obviously this doesn't work. I tried some variations (based on the explanations in the help) but am missing somet

Re: [R] Strange behaviour when using diff with POSIXt and POSIXlt objects

2010-05-21 Thread Brian Diggs
On 5/21/2010 4:00 AM, Julian Burgos wrote: Hi Brian, This is really odd. I keep getting the NA secs answer, only by running these three lines of code in a new session. time3=strptime("2009 06 01 00 47 00",format="%Y %m %d %H %M") time4=strptime("2009 06 01 00 57 00",format="%Y %m %d %H %M")

Re: [R] GPS finding and mark interesting POI within table with large GPS points collection

2010-05-21 Thread Johannes Huesing
Eugeniusz Kałuża [Fri, May 21, 2010 at 04:47:21PM CEST]: > Dear R users, > # > #There is table containing 1000 (lat, lon, time) GPS positions, wchich should > be recognized

[R] escape character OK in R environment, fails in R CMD CHECK

2010-05-21 Thread David Reiss
Hi, I am trying to check a package via R CMD CHECK and it is failing with Error: '\s' is an unrecognized escape in character string starting "\s" The culprit looks something like this: gsub('\\s\\(.*\\)',"","this is a (test, man) dude") which is correctly escaped with the "\\"'s -- but it see

[R] Data reconstruction following PCA using Eigen function

2010-05-21 Thread Julia El-Sayed Moustafa
Hi all, As a molecular biologist by training, I'm fairly new to R (and statistics!), and was hoping for some advice. First of all, I'd like to apologise if my question is more methodological rather than relating to a specific R function. I've done my best to search both in the forum and elsewhere

Re: [R] ERROR: cannot allocate vector of size?

2010-05-21 Thread Yesha Patel
Hi! Thanks for your reply! After running the command below I am certain I am using a 64-bit R. I am running R through a linux cluster system where R is globally available for all users. I have asked the system administrators if they would update their version R but they are not receptive of maki

Re: [R] Concatenation

2010-05-21 Thread David Winsemius
On May 21, 2010, at 12:21 AM, santana sarma wrote: Hi David, SORRY - I am trying to be more clearer this time. Let's say the dataframe has some rows and columns, with unique rownames and column names. The rest of the data in the dataframe are just numbers. So have you tried any of the s

[R] i have question about ARMAX

2010-05-21 Thread Mohamed Abdelaziem Ibrahim
Pro, I am PhD student , i am usuing Rational Expectations Model, I want to model different timeseries with ARMAX models in R because I think that ARMAX models will map best to these data. I want know the steps to use R for ARMAX models I coudn't find any solutions in the R help and therefo

[R] weighted regression using drm() in drc package

2010-05-21 Thread array chip
Hi, I am currently trying to do dose-response curves using weighted 4-parameter model (4PL). The weighting was based on 1/(expected variance) derived from historical data. I tried both drm() from drc package, and nls(), found very different results derived from drm() vs. nls() using "weights=" arg

Re: [R] Reading results of commands in Microsoft Word typed in the terminal window, A question from a Blind R user.

2010-05-21 Thread Greg Snow
The R2wd package can be used to send things to word documents, that may work for you. If you want this done automatically you could look at the txtStart and related functions in the TeachingDemos package and just change the parts that send plain text to the file (sink) with commands from R2wd.

Re: [R] Reading in and writing out one line at a time

2010-05-21 Thread Johannes Huesing
Jan van der Laan [Fri, May 21, 2010 at 11:22:35AM CEST]: > Perhaps you mean something like sapply or apply? > Neither am I certain what he means exactly, but I would use apply and cousins only if I don't care in which sequence the elements are processed. His problem (reading line by line) sound

Re: [R] multiple qplot histograms in one plot

2010-05-21 Thread rajesh j
Awesome. Thats exactly what I want. On Sat, May 22, 2010 at 12:45 AM, Erik Iverson wrote: > > rajesh j wrote: >> >>> Hi, >>> >>> I wish to plot multiple histograms(representing different data so >>> different >>> range along xaxis but y axis is the same) horizontally in ggplot2. I'd >>> like >>

Re: [R] multiple qplot histograms in one plot

2010-05-21 Thread Erik Iverson
rajesh j wrote: Hi, I wish to plot multiple histograms(representing different data so different range along xaxis but y axis is the same) horizontally in ggplot2. I'd like it to look like facets. Is this possible? Can you give a small example, say, using the diamonds dataset, or one of y

Re: [R] loop for in and decimals

2010-05-21 Thread David Winsemius
On May 21, 2010, at 2:18 PM, Robert U wrote: Dear R-users, I'm trying to make the following loop: for (x in 0 : 10) and i would like x to be decimals rather than integers, giving a x range of e.g. 0.0 0.1 0.2 0.3 ... 9.9, 10. Would anyone know how to do that ? with regards, Had you not

Re: [R] loop for in and decimals

2010-05-21 Thread Erik Iverson
Robert U wrote: Dear R-users, I'm trying to make the following loop: for (x in 0 : 10) and i would like x to be decimals rather than integers, giving a x range of e.g. 0.0 0.1 0.2 0.3 ... 9.9, 10. Would anyone know how to do that ? Please start new threads when you have a new question, do no

Re: [R] loop for in and decimals

2010-05-21 Thread Henrique Dallazuanna
Try this: for(x in seq(0, 10, by = 0.1)) On Fri, May 21, 2010 at 3:18 PM, Robert U wrote: > Dear R-users, > > I'm trying to make the following loop: for (x in 0 : 10) and i would like x > to be decimals rather than integers, giving a x range of e.g. 0.0 0.1 0.2 > 0.3 ... 9.9, 10. Would anyone

[R] loop for in and decimals

2010-05-21 Thread Robert U
Dear R-users, I'm trying to make the following loop: for (x in 0 : 10) and i would like x to be decimals rather than integers, giving a x range of e.g. 0.0 0.1 0.2 0.3 ... 9.9, 10. Would anyone know how to do that ? with regards,   [[alternative HTML version deleted]] __

Re: [R] multiple qplot histograms in one plot

2010-05-21 Thread Erik Iverson
rajesh j wrote: Hi, I wish to plot multiple histograms(representing different data so different range along xaxis but y axis is the same) horizontally in ggplot2. I'd like it to look like facets. Is this possible? Can you give a small example, say, using the diamonds dataset, or one of your

Re: [R] plotting the following data

2010-05-21 Thread ANJAN PURKAYASTHA
Thanks all for your suggestions. plot(1:8, f, axes=FALSE) axis(1, at=1:8, labels=time) axis(2) That gave me exactly what I wanted. Anjan On Fri, May 21, 2010 at 12:27 PM, jim holtman wrote: > Not exactly sure what you mean by "equally spaced"; here is one way: > > > x <- read.table(textConnecti

[R] multiple qplot histograms in one plot

2010-05-21 Thread rajesh j
Hi, I wish to plot multiple histograms(representing different data so different range along xaxis but y axis is the same) horizontally in ggplot2. I'd like it to look like facets. Is this possible? -- Rajesh.J [[alternative HTML version deleted]]

Re: [R] reshaping data

2010-05-21 Thread Mia Bengtsson
Yes, that works beautifully on both the test dataset and my real dataset. This was exactly what I was looking for. Thank you! / Mia On May 21, 2010, at 6:10 PM, William Dunlap wrote: > >> -Original Message- >> From: r-help-boun...@r-project.org >> [mailto:r-help-boun...@r-project.org

Re: [R] Levelplot

2010-05-21 Thread apjaworski
I am not sure if I am correct but I think the labels argument pertains only to the counterplot function. Cheers, Andy __ Andy Jaworski 518-1-01 Process Laboratory 3M Corporate Research Laboratory - E-mail: apjawor...@mmm.com Tel: (651) 733-6092 Fax: (651) 7

Re: [R] offlist Re: Svy function doesn't work nested in user-defined function

2010-05-21 Thread David Winsemius
On May 21, 2010, at 11:48 AM, Thomas Lumley wrote: On Thu, 20 May 2010, David Winsemius wrote: Almost. Testing with the examples on svytable help page: test <- function(Z){ fmla <- as.formula( paste(" ~ ", paste(c(Z, "stype"), collapse= "+"))) chisq <- svychisq(

Re: [R] plotting the following data

2010-05-21 Thread jim holtman
Not exactly sure what you mean by "equally spaced"; here is one way: > x <- read.table(textConnection("timef + 0h0.00 + 0.5h0.54 + 1h1.15 + 2h2.33 + 4h1.57 + 6h2.19 + 18h1.45 + 24h1.79"), header=TRUE, as.is=TRUE) > > plot(x$f, xaxt='n') > axis(1, at=1:8, labels

Re: [R] plotting the following data

2010-05-21 Thread S Ellison
plot(1:8, f, axes=FALSE) axis(1, at=1:8, labels=time) axis(2) >>> ANJAN PURKAYASTHA 21/05/2010 17:15:48 >>> Hi, I need to plot $time on the x-axis and $f on the y-axis for the following data: timef 0h0.00 0.5h0.54 1h1.15 2h2.33 4h1.57 6h2.19 18h1.45 24h1.79 I

Re: [R] indexing problem

2010-05-21 Thread arnaud Gaboury
This do the trick : for (i in 1:length(sel) ){ posA<-get(paste(c("Pos",sel[i]),collapse="")) posB<-get(paste(c("Pos",sel[i]+1),collapse="")) } > -Original Message- > From: David Winsemius [mailto:dwinsem...@comcast.net] > Sent: Friday, May 21, 2010 4:00 PM > To: arnaud Ga

[R] weighted regression in drc package

2010-05-21 Thread array chip
Hi, I am currently trying to do dose-response curves using weighted 4-parameter model (4PL). The weighting was based on 1/(expected variance) derived from historical data. I tried both drm() from drc package, and nls(), found very different results derived from drm() vs. nls() using "weights=" arg

[R] plotting the following data

2010-05-21 Thread ANJAN PURKAYASTHA
Hi, I need to plot $time on the x-axis and $f on the y-axis for the following data: timef 0h0.00 0.5h0.54 1h1.15 2h2.33 4h1.57 6h2.19 18h1.45 24h1.79 I want the order of the data-points to be retained and the x-coordinates of each of the 8 data-points to be equal

Re: [R] reshaping data

2010-05-21 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Mia Bengtsson > Sent: Friday, May 21, 2010 3:39 AM > To: Dennis Murphy; Henrique Dallazuanna > Cc: r-help@r-project.org > Subject: Re: [R] reshaping data > > Thank you Dennis an

Re: [R] Levelplot

2010-05-21 Thread Peter Ehlers
On 2010-05-21 8:57, zac...@lmb.uni-muenchen.de wrote: Dear mailing list, I am trying to find out, how do a levelplot without labels on the x- and y-axis. The labels=FALSE does not work...can anyone help me? m<- matrix(1:25, ncol=5) levelplot(m, labels=F) 1. This is a function in the lattice

Re: [R] offlist Re: Svy function doesn't work nested in user-defined function

2010-05-21 Thread Thomas Lumley
On Thu, 20 May 2010, David Winsemius wrote: Almost. Testing with the examples on svytable help page: test <- function(Z){ fmla <- as.formula( paste(" ~ ", paste(c(Z, "stype"), collapse= "+"))) chisq <- svychisq( fmla, design=rclus1, s

Re: [R] Levelplot

2010-05-21 Thread Francisco J. Zagmutt
This would do levelplot(m, xlab="", ylab="") F zac...@lmb.uni-muenchen.de wrote: Dear mailing list, I am trying to find out, how do a levelplot without labels on the x- and y-axis. The labels=FALSE does not work...can anyone help me? m <- matrix(1:25, ncol=5) levelplot(m, labels=F) Regards,

[R] a matter of etiquette/Fw: dmvsnorm & mvst in fMultivar

2010-05-21 Thread Adelchi Azzalini
AA> In 2008, I have spotted some errors in a package, one which is AA> likely to have many users (I am not one myself). The more serious AA> errors are in the documentation, since they lead to a completely AA> distorted interpretation of the outcome; in addition, there is (at AA> least) one progr

[R] Levelplot

2010-05-21 Thread zacher
Dear mailing list, I am trying to find out, how do a levelplot without labels on the x- and y-axis. The labels=FALSE does not work...can anyone help me? m <- matrix(1:25, ncol=5) levelplot(m, labels=F) Regards, Benedikt __ R-help@r-project.org mailin

Re: [R] Concatenation

2010-05-21 Thread Wu Gong
Sorry, I made a mistake. Should add "byrow = TRUE". Using randomly created values can't check the result, a sequence will be better. olddata <- data.frame(matrix(1:200, nrow=40, byrow = TRUE)) newdata <- data.frame(matrix(as.vector(t(olddata)), nrow=nrow(olddata)/10,byrow = TRUE)) dim(olddata) di

Re: [R] lme: model variance and error by group

2010-05-21 Thread ONKELINX, Thierry
Have a look at ?varClasses. You could you something like varIdent(form = ~ 1|areatrai) or varExp(form = ~areatrai) R-sig-mixed-models is a better list for this kind of questions. Thierry ir. Thierry Onkelinx Instituut

Re: [R] viewing function code

2010-05-21 Thread David Winsemius
Which function? > getAnywhere(confint) A single object matching ‘confint’ was found It was found in the following places package:stats namespace:stats with value function (object, parm, level = 0.95, ...) UseMethod("confint") > methods(confint) [1] confint.default confint.glm*

[R] establishing socket

2010-05-21 Thread wesley mathew
Dear All I would like to know, how to establishing socket in R language. Distributed and parallel Grid data mining is my research project. I want to work in nws , for sharing classifiers between different nodes. ws= newWorkSpace(' R Space'). It shows one error "socket not established". Can anyon

[R] GPS finding and mark interesting POI within table with large GPS points collection

2010-05-21 Thread Eugeniusz Kałuża
Dear R users, # #There is table containing 1000 (lat, lon, time) GPS positions, wchich should be recognized and labeled in every row of that #recognized position by label fr

Re: [R] indexing problem

2010-05-21 Thread arnaud Gaboury
This maybe a solution. I am currently working with something like : For (i in length(select)){ posA<-get(paste(c("Pos",select[i]),collapse="")) posB<-get(paste(c("Pos",select[i+1]),collapse="")) } Not yet finalized. TY for the tip about "select" not to use as an object name > -

[R] lme: model variance and error by group

2010-05-21 Thread Tursiops
Hello I am trying to reproduce a mixed regression model published in (J Evol Biol 12:94-102) with PASW 17.03. The authors used SAS to fit the model using the following syntaxis: proc mixed nobound; class area individ trait; model a = side trait area side*trait side*area trait*area/ddfm = satterth

[R] viewing function code

2010-05-21 Thread Data Analytics Corp.
Hi, I want to view the code for the function confint in the stats package. Typing just confint doesn't work. How can I view the code? Thanks, Walt Walter R. Paczkowski, Ph.D. Data Analytics Corp. 44 Hamilton Lane Plainsboro, NJ 08536 (V) 6

Re: [R] Concatenation

2010-05-21 Thread Wu Gong
A dummy way is to resequence or rematrix olddata <- data.frame(matrix(rnorm(200), nrow=40)) newdata <- data.frame(matrix(as.vector(t(olddata)), nrow=nrow(olddata)/10)) dim(olddata) dim(newdata) - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/Concatenation-tp

Re: [R] IF-ELSE question

2010-05-21 Thread Jorge Ivan Velez
Hi Robert, Consider the following: x <- c(1, 3, 5, 4, 6) ifelse(x < 6 & x > 1, 1, 2) [1] 2 1 1 1 2 HTH, Jorge On Fri, May 21, 2010 at 9:36 AM, Robert U <> wrote: > Dear > R-users, > > > > I've been trying to write a script but i encounter much problems with basic > functions.. That is, i try

Re: [R] intersect() without discarding duplicates?

2010-05-21 Thread Jonathan
Thank you, David and Gabor, for the creative solutions, and for introducing me to pmin() Jonathan On Thu, May 20, 2010 at 9:55 PM, Gabor Grothendieck wrote: > Try this one liner. The first argument of rep is the sorted > intersection and the second argument is the calculated from the > paral

Re: [R] indexing problem

2010-05-21 Thread David Winsemius
On May 21, 2010, at 9:19 AM, arnaud Gaboury wrote: Dear group, Here is my environment : ls() [1] "l" "PLglobal" "Pos100415" "Pos100416" "Pos100419" "Pos100420" "position" "select" "Trad100415" "Trad100416" "Trad100419" "Trad100420" "trade" "y" With objects : l [1

Re: [R] IF-ELSE question

2010-05-21 Thread Tal Galili
Example: if (abs(-1-1) <= 3 & abs(1+1) <= 3) {print(1)} else {print(2)} Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statis

Re: [R] IF-ELSE question

2010-05-21 Thread Sarah Goslee
You need parentheses enclosing the entire if() statement: if(something & somethingelse) { do this } Sarah On Fri, May 21, 2010 at 9:36 AM, Robert U wrote: > Dear > R-users, > > > > I've been trying to write a script but i encounter much problems with basic > functions.. That is, i try to wri

[R] IF-ELSE question

2010-05-21 Thread Robert U
Dear R-users, I've been trying to write a script but i encounter much problems with basic functions.. That is, i try to write a simple IF ELSE statement, with 2 requirements for the IF : if (abs(x + Dataset$LAT[1]) <= 3) and (abs(y + Dataset$LONG[1]) <= 3) {z <- 1} else {z <-0} This does n

[R] indexing problem

2010-05-21 Thread arnaud Gaboury
Dear group, Here is my environment : > ls() [1] "l" "PLglobal" "Pos100415" "Pos100416" "Pos100419" "Pos100420" "position" "select" "Trad100415" "Trad100416" "Trad100419" "Trad100420" "trade" "y" With objects : > l [1] "100415" "100416" "100419" "100420" "100421" "10

Re: [R] Time dependent Cox model

2010-05-21 Thread Marco Barbàra
> > ... interactions between covariables and time. > > A model such as "coxph(Surv(ptime, pstat) ~ age + age*ptime, " > is invalid -- it is not at all what you think. Actually what i'm trying to fit is coxph(Surv(start,end,event)~age+age:start) to model a time-varying effect \beta(t)

Re: [R] sort a data.frame

2010-05-21 Thread Kevin Wright
Also see mixedsort and mixedorder in the gtools package. dd <- data.frame(b = c("chr2", "chr1", "chr15", "chr13"), x = c("A", "D", "A", "C"), y = c(8, 3, 9, 9), z = c(1, 1, 1, 2)) dd[gtools::mixedorder(dd$b),] R> b x y z 2 chr1 D 3 1 1 chr2 A 8 1 4 chr13 C 9 2 3 chr15 A 9 1

Re: [R] Question regarding GBM package

2010-05-21 Thread Max Kuhn
The caret package can do a lot of that for you: http://www.jstatsoft.org/v28/i05/paper http://cran.r-project.org/web/packages/caret/index.html http://cran.r-project.org/web/packages/caret/vignettes/caretTrain.pdf Max On Fri, May 21, 2010 at 8:05 AM, Roel Meeuws wrote: > Dear R expert

Re: [R] sort a data.frame

2010-05-21 Thread David Winsemius
But you should both be warned that would only be correct for a species where there were 24 chromosomes. This would work for humans and species with a higher number: dd[ order(as.numeric(substring(dd$b, 4), substring(dd$b, 4))), ] -- David Winsemius, MD West Hartford, CT On May 20, 2010, a

[R] Question regarding GBM package

2010-05-21 Thread Roel Meeuws
Dear R expert I have come across the GBM package for R and it seemed appropriate for my research. I am trying to predict the number of FPGA resources required by a Software Function if it were mapped onto hardware. As input I use software metrics (a lot of them). I already use several regression

Re: [R] Time dependent Cox model

2010-05-21 Thread Terry Therneau
> ... interactions between covariables and time. A model such as "coxph(Surv(ptime, pstat) ~ age + age*ptime, " is invalid -- it is not at all what you think. If cph flags this as an error that is a good thing: I should probably add the same message to coxph. > Is is somewhat sensible to

Re: [R] Strange behaviour when using diff with POSIXt and POSIXlt objects

2010-05-21 Thread Julian Burgos
Hi Brian, This is really odd. I keep getting the NA secs answer, only by running these three lines of code in a new session. > time3=strptime("2009 06 01 00 47 00",format="%Y %m %d %H %M") > time4=strptime("2009 06 01 00 57 00",format="%Y %m %d %H %M") > diff(c(time3,time4)) Time difference of

Re: [R] vaiable in lm

2010-05-21 Thread Gabor Grothendieck
Try this: lm(y ~., tmp) On Fri, May 21, 2010 at 3:54 AM, Yuan Jian wrote: > Hi, > > if I know the colnames x and y in the following example, I can easily to do > lm. > tmp <- data.frame(x=c(1,1.2),y=c(1,2)) > lm(y ~ x, data=tmp) > > when the colnames are variable, what should I do? for example

Re: [R] reshaping data

2010-05-21 Thread Mia Bengtsson
Thank you Dennis and Henrique for your help! Both solutions work! I just need to find a way of removing the empty "cells" from the final "long" dataframe since they are not NAs. Maybe there is an easier way of doing this of the data is not treated as a dataframe? The original data file that is

Re: [R] select elements in a list

2010-05-21 Thread arnaud Gaboury
TY Ivan select <- l[which(l==x):which(l==y)] returns the correct result. > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Ivan Calandra > Sent: Friday, May 21, 2010 11:20 AM > To: r-help@r-project.org > Subject: Re: [R] se

Re: [R] Reading in and writing out one line at a time

2010-05-21 Thread Jan van der Laan
Perhaps you mean something like sapply or apply? When d is indeed a data.frame with one column: sapply(d[,1], mash) Regards, Jan van der Laan On Thu, May 20, 2010 at 12:47 AM, sedm1000 wrote: > > I hope that somebody can help me with this - I think very simple - issue...? > > I am running a

Re: [R] select elements in a list

2010-05-21 Thread Ivan Calandra
Hi, This should work: select <- l[which(l==x):which(l==y)] The problem is that you tried to select the values, but gave x and y as indexes. That's why you didn't get the expected result. See ?which for more info. HTH, Ivan Le 5/21/2010 11:07, arnaud Gaboury a écrit : Dear group, Here is a

[R] select elements in a list

2010-05-21 Thread arnaud Gaboury
Dear group, Here is a list : l <- list("100415", "100416", "100419", "100420", "100421", "100422", "100423", "100426", "100427", "100428", "100429", "100430", "100503", "100504", "100505", "100506", "100507", "100510", "100511", "100512", "100513") I need to access part of it with

Re: [R] vaiable in lm

2010-05-21 Thread Ivan Calandra
Hi! The problem is that paste() returns a character string. You can use get() this way: lm(y ~ get(paste("aa",1,sep="_")), data = tmp) Or: lm(tmp[[2]]~tmp[[1]], data=tmp) HTH, Ivan Le 5/21/2010 09:54, Yuan Jian a écrit : Hi, if I know the colnames x and y in the following example, I can eas

Re: [R] Reading in and writing out one line at a time

2010-05-21 Thread Uwe Ligges
On 20.05.2010 00:47, sedm1000 wrote: I hope that somebody can help me with this - I think very simple - issue...? I am running a package that only accepts one line at a time, but I would like to run this package on a dataframe of>500 lines. Dataframe "d" is a single column: APPLES PEARS AUB

Re: [R] vaiable in lm

2010-05-21 Thread Uwe Ligges
On 21.05.2010 09:54, Yuan Jian wrote: Hi, if I know the colnames x and y in the following example, I can easily to do lm. tmp<- data.frame(x=c(1,1.2),y=c(1,2)) lm(y ~ x, data=tmp) when the colnames are variable, what should I do? for example colnames(tmp)[1]<- paste("aa",1,sep="_") lm(y ~ pas

Re: [R] Multiclass SVM

2010-05-21 Thread Uwe Ligges
I think kernlab can do. Also the svmlight implementation that has a rather crude interface in package klaR. Uwe Ligges On 20.05.2010 01:48, Xiyan Lon wrote: I am learning classification using SVM for research (survey). The data that I have had some class. I know that the library (e1071) can o

Re: [R] How to execute multiple R scripts sequentially in unix background

2010-05-21 Thread Detlef Steuer
On Fri, 21 May 2010 03:29:49 -0400 Yong Wang wrote: > Dear list > > I need to 1) run several R scripts sequentially due to results waiting > and 2) run them in unix background since my ssh frequently timeout for > some reason. If this is the main obstacle you should learn about screen! http://

Re: [R] crosstabling multiple variables at once

2010-05-21 Thread Uwe Ligges
On 20.05.2010 19:16, Biau David wrote: Hi, I am trying to describe a data.frame by obtaining multiple crosstable summary statistics at once. I have tried table, xtab, crosstable, summaryBy and describe but none of these functions seems to allow muliple conparisons at once. Here, is what

Re: [R] How to execute multiple R scripts sequentially in unix background

2010-05-21 Thread Uwe Ligges
On 21.05.2010 09:29, Yong Wang wrote: Dear list I need to 1) run several R scripts sequentially due to results waiting and 2) run them in unix background since my ssh frequently timeout for some reason. if paste following codes to unix R --vanilla script1& R --vanilla script2& R --vanilla scr

Re: [R] ERROR: cannot allocate vector of size?

2010-05-21 Thread Uwe Ligges
At first, I'd try with an R version from 2010 rather than one from 2007. Next, I'd try to be sure to really have a 64-bit version of R rather than a 32 bit one which is what I suspect. Best, Uwe Ligges On 20.05.2010 20:10, Yesha Patel wrote: I've looked through all of the posts about this is

[R] vaiable in lm

2010-05-21 Thread Yuan Jian
Hi, if I know the colnames x and y in the following example, I can easily to do lm. tmp <- data.frame(x=c(1,1.2),y=c(1,2)) lm(y ~ x, data=tmp) when the colnames are variable, what should I do? for example colnames(tmp)[1] <- paste("aa",1,sep="_") lm(y ~ paste("aa",1,sep="_"), data = tmp) it gives

[R] How to execute multiple R scripts sequentially in unix background

2010-05-21 Thread Yong Wang
Dear list I need to 1) run several R scripts sequentially due to results waiting and 2) run them in unix background since my ssh frequently timeout for some reason. if paste following codes to unix R --vanilla script1 & R --vanilla script2 & R --vanilla script3 & will result in simultaneous inst

Re: [R] Concatenation

2010-05-21 Thread Shi, Tao
Well, it seems a simple "c" will do. e.g. df <- matrix(rnorm(100), ncol=4) c(t(df[1:10,])) # concatenate rows c(df) # concatenate columns > >From: santana sarma >To: "Shi, Tao" ; r-help@r-project.org >Sent: Thu, May 20, 2010 11:45:25 PM >Subject: Re: Concatenation > > >Ok -let's forget