Skip to content
Prev 7740 / 29559 Next

Clipping grid using shapefile?

Sorry to reply to my own post, but now that I think about this, it looks
like 'clip' is a raster containing 1's where there's data and NA where
there isn't.  This makes me think that something like this:

    > mean(ppt01[clip,], na.rm = TRUE)

would give me the mean that I want.  Unfortunately, I get this:

    *** caught segfault ***
    address 0x7f626f27c758, cause 'memory not mapped'

    Traceback:
     1: ppt01[clip, ]
     2: mean(ppt01[clip, ], na.rm = TRUE)

Is there a more memory efficient way to do this, especially since I'm
dealing with 15 data points out of 20,199,315?

Thanks,

Chris