I want to select a subset of my map (a SpatialPolygonsDataFrame) to create a new vector map = part of the initial map included inside a given polygon (eventually, inside several polygons).
I have a large study area, under the object "parcel", and would like to select the part of the map inside the polygon "hr_kud". This is basically the part of my study area used by an animal, so I want to compute basic statistics on this new map and used it for new analyses (of habitat selection).
I have to repeat this operation for about 100 animals...
Here are my data :
parcel = my study area map. and hr_kud = an example of homerange used to reduce the study area
Here is a part of my R code, used under Rstudio (R version 2.15.2 (2012-10-26)) :
plot(hr_kud, col="red", add=TRUE)
And when I run my final command, it causes Rstudio to crash :
hr_map <- gIntersection(parcel, hr_kud, byid=TRUE)
It is not the first crash reported, but non of the answers find on the net are efficient for me... It's exactly the same using R and all my packages are updated.
So If you have any idea of why it's crashing, or of an alternative method to create my subset map or intersect two SpatialPolygonsDataFrame in R, I will be really appreciated !
thanks in advance,