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
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
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,
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
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
5 matches
Mail list logo