Well, you need to find some variable to use for subsetting the data.

Can you share an example of your data?

Would something like the following work for you?

stateID <- c("AL","AK","AR","CA","DE","FL","GA","MN","WA","WI","WY")
var1 <- c(0,0,0,0,0,0,0,0,0,2,0)
df <- data.frame(stateID,var1)

statesWanted <- c("MN","WI")

subsettedDataFrame <- df[df$stateID %in% statesWanted,]




On Sun, May 30, 2010 at 9:01 PM, Peter Larson <pslars...@gmail.com> wrote:

>  They don't show up as NA's. They are just 0's. The 0 values in the states
> I am interested in are correct, however.
>
> Pete
>
>
> On 2010/05/30 20:28, Matt Beard wrote:
>
> Have you looked into functions such as na.omit()?
>
> Matt
>
> On Sun, May 30, 2010 at 7:54 PM, Peter Larson <pslars...@gmail.com> wrote:
>
>> Hello all,
>>
>> I have data for several states and no data for most. I just want to subset
>> the states I have data for and ignore the rest.
>>
>> Is there anyway to do this? I have a shapefile and have read it in with
>> ReadShapePoly successfully, but I don't need all 50 American states.
>>
>> Thanks,
>>
>> Pete
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo@stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to