Re: [R] drop a letter

2007-05-16 Thread Vladimir Eremeev
elyakhlifi mustapha wrote: > > hello, > how can I do to drop C from this character "C325" ? > 1. if C is always single and always first: > substring("C325",2) 2. more generic solution, drops all letters > sp<-unlist(strsplit("C325",split="[A-Z]")) > sp<-sp[nchar(sp)>0] > sp -- View this m

Re: [R] drop a letter

2007-05-16 Thread Chuck Cleland
elyakhlifi mustapha wrote: > hello, > how can I do to drop C from this character "C325" ? > x <- "C325" > substring(x, first=2) [1] "325" > gsub("C", "", x) [1] "325" > gsub("[A-Z]", "", x) [1] "325" ?substring ?gsub > > ___

[R] drop a letter

2007-05-16 Thread elyakhlifi mustapha
hello, how can I do to drop C from this character "C325" ? _ [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.

Re: [R] drop

2006-09-28 Thread Prof Brian Ripley
On Thu, 28 Sep 2006, Hans-Peter wrote: > Hello, > > What's the best/recommended way to drop the dimension of a data.frame? > Probably "test[,,]" but I am not sure. I would prefer an explicit > function, but drop doesn't work with frames and I didn't find > something in the helpfiles/mailarchive.

[R] drop

2006-09-28 Thread Hans-Peter
Hello, What's the best/recommended way to drop the dimension of a data.frame? Probably "test[,,]" but I am not sure. I would prefer an explicit function, but drop doesn't work with frames and I didn't find something in the helpfiles/mailarchive. Example: test <- data.frame( x = 1:7 ) str( drop(

Re: [R] R drop behavior -- set as option in later version?

2006-09-08 Thread Gregor Gorjanc
Martin Maechler wrote: > Wrong Mailing List !! > > Proposals for changes to R should be discussed on R-devel, see > the posting guide. > I'll reply separately, but only CC to R-devel. You are right, but I think that this might be an overkill. But, who am I to decide that anyway! I actually excite

Re: [R] R drop behavior -- set as option in later version?

2006-09-08 Thread Martin Maechler
Wrong Mailing List !! Proposals for changes to R should be discussed on R-devel, see the posting guide. I'll reply separately, but only CC to R-devel. Martin Maechler, ETH Zurich __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/lis

Re: [R] R drop behavior -- set as option in later version?

2006-09-08 Thread Gregor Gorjanc
Balaji S. Srinivasan stanford.edu> writes: > ... Hello, I agree with you that you find yourself typing the same constructs over and over. I think that we need to distinguish two modes of working with R. If you do analysis, then you can really get tired of typing drop=FALSE, na.rm=TRUE etc. But th

[R] R drop behavior -- set as option in later version?

2006-09-08 Thread Balaji S. Srinivasan
Hi, I know the topic of drop=TRUE/FALSE has been discussed quite a bit, but I was wondering whether it might be possible to set "drop=FALSE" as a global setting (e.g. as an option in options()) so that one does not have to remember to write it every time you do an operation which might return a 1

Re: [R] drop elements of vector by class

2005-06-17 Thread McGehee, Robert
a <- data.frame(a = 1:2, b = c("a", "b"), c = I(c("a", "b"))) a <- a[ , !sapply(a, class) %in% "factor"] -Original Message- From: E. Michael Foster [mailto:[EMAIL PROTECTED] Sent: Friday, June 17, 2005 10:58 AM To: r-help@stat.ma

Re: [R] drop elements of vector by class

2005-06-17 Thread Dimitris Rizopoulos
--- From: "E. Michael Foster" <[EMAIL PROTECTED]> To: Sent: Friday, June 17, 2005 4:57 PM Subject: [R] drop elements of vector by class > i'm trying to build a little summary table for the contents of a > data frame. > > t<-sapply(macro, data.class) >

[R] drop elements of vector by class

2005-06-17 Thread E. Michael Foster
i'm trying to build a little summary table for the contents of a data frame. t<-sapply(macro, data.class) c<-sapply(macro, length) m<-sapply(macro, mean, na.rm=T, digits=2) cbind(type=t, n=c , mean=m) I want to drop the variables that are factors so I can include -max- and -min- in my table. -ma

Re: [R] drop rows

2004-06-30 Thread Peter Wilkinson
his ... h looks like your working with microarray data as well The actual matrix that I am working with is 19000 x 340 Thanks for the help, that was perfect. I am still getting used to the R language way of doing things.I will look into the apply function as you have written it. Pete