[R] Basic question ( too broad for help topics).
Jim Burke
j.burke at earthlink.net
Thu Oct 29 06:53:44 CET 2009
I have searched help topics but don't know exactly what to search for.
Need to use my_num to find any matching STREPs in my_df
my_num <-
c("101","102","103","104","105","107","108","112","113","114","115")
## "my_df" has 8,000 different STREPS in it.
## I have a statement where I can select ONE item from data frame "my_df"
out_df <- my_df[ my_df$STREP=="101", c("COUNTY", "FIPS", "STSEN",
"STREP", "PREC")]
## A comparative SQL command
## SELECT
## COUNTY, FIPS, STSEN, STREP, PREC
## FROM my_df
## WHERE my_df.STREP
IN("101","102","103","104","105","107","108","112","113","114","115")
## ORDER BY STREP;
Thanks for any help,
Jim
More information about the R-help
mailing list