[R] elegant way of removing NA's and selecting specific values from a data.frame

2011-07-06 Thread Jim Maas
I have a data.frame e and would like to extract the 23rd column, remove any NA's and then remove any values = 30. I can do it in steps such as this but have failed to figure out how to do it in a single line any suggestions? first - e[,23] second - first[!is.na(first)] third -

Re: [R] elegant way of removing NA's and selecting specific values from a data.frame

2011-07-06 Thread Bert Gunter
? This is basic. Please read An Intro to R before posting any more such questions if you have not already done so. -- Bert On Wed, Jul 6, 2011 at 8:35 AM, Jim Maas j.m...@uea.ac.uk wrote: I have a data.frame e and would like to extract the 23rd column, remove any NA's and then remove any

Re: [R] elegant way of removing NA's and selecting specific values from a data.frame

2011-07-06 Thread William Dunlap
The question was whether you could do this 'in a single line' and the word 'elegant' was in the subject line. Those two things don't always go together. You can put semicolons between the statements so they all can go on one line, but that isn't very elegant. You could collapse the three