[R] Selecting from a Dataframe
abunn at whrc.org
Tue Apr 4 19:54:16 CEST 2006
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Dan Chan
> Sent: Tuesday, April 04, 2006 1:42 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Selecting from a Dataframe
> I have a data frame with many fields and there are many records.
> One of the fields is county names in Georgia.
> I want to select all the records for 3 of the counties.
> How can I do that?
> DailyCounty is the dataframe that holds the data. One of the fields is
> County. The following statement will extract all records for Appling
> County and store as Appling.
> Appling <- subset(DailyCounty, DailyCounty$County== ("Appling"))
ThreeCounties <- subset(DailyCounty, County== ("Appling") |
County== ("Baldwin") | County== ("Barrow"))
> I suppose I can do the same for the other two counties, but how can I
> combine them into one single data frame? Each county has a different
> numbers of records in the dataframe DailyCounty.
> Thank you.
> Daniel Chan
> Georgia Forestry Commission
> P O Box 819
> Macon, GA
> Tel: 478-751-3508
> Fax: 478-751-3465
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide!
More information about the R-help