-1

I have a a list of 700+ fips codes that I'm trying to subset into a smaller dataset. I know I could just list them all out like this :

data <- data[(data$fips == 65409, 84840, etc....) ,]

But this is unrealistic as I have 700+ fips codes to subset. I'm looking for a way to subset using a list of fips codes I get from :

fips <- unique(DustBowlData_Pre$fips)   #Get all fips codes

Edit : I tried to clarify further, but it's hard to submit an example because of the sheer number.

Thanks for any help you can provide.

Vedda
  • 7,066
  • 6
  • 42
  • 77
  • Please add expected output. It is not clear what you trying to do. – zx8754 Dec 02 '14 at 08:50
  • 1
    "it's hard to submit an example because of the sheer number": Please read [**this**](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610#5963610) – Henrik Dec 02 '14 at 09:06

1 Answers1

2

This is what worked.

prism.dd <- prism.d[(prism.d$fips %in% fips) ,]
Vedda
  • 7,066
  • 6
  • 42
  • 77