Re: [R] Subsetting data where the condition is that the value of some column contains some substring

2009-03-20 Thread Max Bane
e matches, in which > case you can have a length of zero if there are no matches.  Makes it > harder to create the subsets.  You have to test for zero length and > then do something special. > > On Fri, Mar 20, 2009 at 9:20 PM, Max Bane wrote: >> Thanks, Jim (and Mark, who repl

Re: [R] Subsetting data where the condition is that the value of some column contains some substring

2009-03-20 Thread Max Bane
 P      100.0 132408   0.3648810 > 7             donate(mysister,it)      P      100.0 130720   0.3602293 > 10   give(mylittlesister,thebook)      P       91.8 112032   0.3087302 > 11 donate(mylittlesister,thebook)      P       98.4 114048   0.3142857 > 12       donate(mysister,thebook)  

[R] Subsetting data where the condition is that the value of some column contains some substring

2009-03-20 Thread Max Bane
) [1] input output corpusFreq pvolOT pvolRatioOT <0 rows> (or 0-length row.names) The type of the input column is definitely character. To be double sure: > subset(dataP, as.logical(length(grep("her", as.character(input))