Re: [R] subseting data

2011-05-02 Thread Steven Kennedy
You can use grepl: > dat<-data.frame(test=c("abc","cdf","dabc")) > d<-subset(dat,grepl(test,"abc")) > d test 1 abc 3 dabc On Mon, May 2, 2011 at 7:03 PM, Matevž Pavlič wrote: > Hi, > > > > Is it possible (i am sure it is) to subset data from a data.frame on the > basis of SQL >LIKE< oper

Re: [R] subseting data

2011-05-02 Thread Uwe Ligges
egation: d <- subset(dat, !grepl("abc", test)) Uwe Ligges Thanks, m From: Steven Kennedy [mailto:stevenkennedy2...@gmail.com] Sent: Monday, May 02, 2011 11:30 AM To: Matevž Pavlič Cc: r-help@r-project.org Subject: Re: [R] subseting data You can use grepl: dat<-data

Re: [R] subseting data

2011-05-02 Thread Matevž Pavlič
only the first element will be used > d test 1 abc 2 cdf 3 dabc I can't seem to make it work. Also how would i use the grepl() to select only those that are not like i.e. »GP«? Thanks, m From: Steven Kennedy [mailto:stevenkennedy2...@gmail.com] Sent: Monday, May 02,

Re: [R] subseting data

2011-05-02 Thread Andrew Robinson
I wonder if grep() will help you? Cheers Andrew On Mon, May 02, 2011 at 11:03:52AM +0200, Matev? Pavli? wrote: > Hi, > > > > Is it possible (i am sure it is) to subset data from a data.frame on the > basis of SQL >LIKE< operator. I.e., i would like to subset a data where only > values w

[R] subseting data

2011-05-02 Thread Matevž Pavlič
Hi, Is it possible (i am sure it is) to subset data from a data.frame on the basis of SQL >LIKE< operator. I.e., i would like to subset a data where only values which contains a string >GP< would be used? Example: Gp<-subset(DF, DF$USCS like >GP<) This like of course is not wor