[R] dropping rows

Thomas Lumley tlumley at u.washington.edu
Thu Dec 2 02:35:03 CET 2004


On Wed, 1 Dec 2004, Liaw, Andy wrote:

> See ?subset, especially the example there.
>
> (I'm surprised this function isn't in R-intro...)

Much of R-intro was written as an introduction to S before R existed and 
later translated, so there are quite a few things that aren't in it but 
would be in a guide written from scratch.

 	-thomas

>
> Andy
>
>> From: Tobias Muhlhofer
>>
>> Hi!
>>
>> Sorry for asking a trivial questions, but I can't seem to
>> figure this out.
>>
>> I have a dataframe called master containing 30-odd variables.
>>
>> In this dataframe, I have observations across these 30 variables from
>> 1930 to 2003 (I've made a "year" variable). How can I drop
>> all rows for
>> which the year is less than 1960? I'm assuming something with
>> ifelse()
>> but I can't quite figure it out.
>>
>> I would appreciate a suggestion of some syntax.
>>
>> Thanks!
>> 	Toby
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide!
>> http://www.R-project.org/posting-guide.html
>>
>>
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle




More information about the R-help mailing list