[R] Basic simple question

Jim Burke j.burke at earthlink.net
Thu Oct 29 06:04:59 CET 2009


I have a statement like below.

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"
txhd_df <- prec_dist_df[ my_df$STREP=="101", c("COUNTY", "FIPS", 
"STSEN", "STREP", "PREC")]

I would like to make R compare and deliver only the STREPS that are in 
my_num.

A comparative SQL command WHERE STREP 
IN("101","102","103","104","105","107","108","112","113","114","115")

Thanks for any help,
Jim




More information about the R-help mailing list