Re: [R] subsetting data-frame by vector of characters

2008-06-13 Thread Wacek Kusnierczyk
james perkins wrote: > Thanks a lot for that. Its the %in% I needed to work out mainly > > large didn't mean anything in particular, just that it gets quite long > with the real data. > I did mean: names = c("John", "Phil", "Robert") > > The only problem is that using the method you suggest is that

Re: [R] subsetting data-frame by vector of characters

2008-06-13 Thread Peter Dalgaard
james perkins wrote: > Thanks a lot for that. Its the %in% I needed to work out mainly > > large didn't mean anything in particular, just that it gets quite long > with the real data. > I did mean: names = c("John", "Phil", "Robert") > > The only problem is that using the method you suggest is that

Re: [R] subsetting data-frame by vector of characters

2008-06-13 Thread james perkins
Thanks a lot for that. Its the %in% I needed to work out mainly large didn't mean anything in particular, just that it gets quite long with the real data. I did mean: names = c("John", "Phil", "Robert") The only problem is that using the method you suggest is that I lose the indexing, ie in t

Re: [R] subsetting data-frame by vector of characters

2008-06-13 Thread Wacek Kusnierczyk
james perkins wrote: > Hi, > > I have a very simple problem but I can't think how to solve it without > using a for loop and creating a large logical vector. However given > the nature of the problem I am sure there is a "1-liner" that could do > the same thing much more efficiently. > > bascially

Re: [R] subsetting data-frame by vector of characters

2008-06-13 Thread Chuck Cleland
On 6/13/2008 10:07 AM, james perkins wrote: Hi, I have a very simple problem but I can't think how to solve it without using a for loop and creating a large logical vector. However given the nature of the problem I am sure there is a "1-liner" that could do the same thing much more efficientl

[R] subsetting data-frame by vector of characters

2008-06-13 Thread james perkins
Hi, I have a very simple problem but I can't think how to solve it without using a for loop and creating a large logical vector. However given the nature of the problem I am sure there is a "1-liner" that could do the same thing much more efficiently. bascially I have a dataframe with charac