Re: [R] How to filter a data frame with user defined function?

2015-01-28 Thread Jim Lemon
Hi Monnand, Is this what you are looking for? data[grep(prefix1,data$name),] data[grep(prefix2,data$name),] Jim On Wed, Jan 28, 2015 at 6:51 PM, Monnand monn...@gmail.com wrote: Hi all, This really annoyed since I thought this would be easy with some higher order function. Here is what I

[R] How to filter a data frame with user defined function?

2015-01-27 Thread Monnand
Hi all, This really annoyed since I thought this would be easy with some higher order function. Here is what I want: I have a data frame with two columns, one is ID, another one is Name. I want to get all rows whose name starts with some specific prefix. I thought this should be a one-liner