[R] subseting data

Andrew Robinson A.Robinson at ms.unimelb.edu.au
Mon May 2 11:37:16 CEST 2011


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 which contains a string >GP< would be used? 
> 
>  
> 
> Example:
> 
>  
> 
> Gp<-subset(DF, DF$USCS like >GP<)
> 
>  
> 
> This like of course is not working, 
> 
>  
> 
> Thanks, m
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Andrew Robinson  
Program Manager, ACERA 
Department of Mathematics and Statistics            Tel: +61-3-8344-6410
University of Melbourne, VIC 3010 Australia               (prefer email)
http://www.ms.unimelb.edu.au/~andrewpr              Fax: +61-3-8344-4599
http://www.acera.unimelb.edu.au/

Forest Analytics with R (Springer, 2011) 
http://www.ms.unimelb.edu.au/FAwR/
Introduction to Scientific Programming and Simulation using R (CRC, 2009): 
http://www.ms.unimelb.edu.au/spuRs/



More information about the R-help mailing list