Dear subscribers,

After a quick search on the net and on this mailing list, I didn't find any
solution, so I hope my question won't be that trivial.

I want to select a subset of a map (a SpatialPolygonsDataFrame) to create a
new vector map = a 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 to use it
for new analyses (of habitat selection). I have to repeat this operation
for about 100 animals...

Here are my data : http://dl.free.fr/vX4TA8nsE

*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)) :

> library(rgeos)> load("Data.RData")


> class(parcel)[1] "SpatialPolygonsDataFrame"
attr(,"package")
[1] "sp"

> head(parcel)  AREAHA RECNO      AREA AREASQKM        OS_06 GRD_CAT_06
0 0.0519     0  519.1941        0 chemin prive        way
1 0.0127     1  127.0963        0 chemin prive        way
2 0.0596     2  596.2204        0 chemin prive        way
3 0.0248     3  248.0452        0    route D90        way
4 0.0375     4  375.0141        0 route privee        way
5 0.1260     5 1260.3941        0 chemin prive        way

> dim(parcel) [1] 20069 7 > class(hr_kud) [1] "SpatialPolygonsDataFrame"
attr(,"package") [1] "sp" > object.size(hr_kud) 9536 bytes >
object.size(parcel)
88250824 bytes



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 none of the answers find on the net
are efficient for me... It's exactly the same using R or Rstudio 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 to intersect two SpatialPolygonsDataFrame in R,
It will be really appreciated !

thanks in advance,
Sophie

	[[alternative HTML version deleted]]

