[R-sig-eco] Estimating HR overlap by adehabitatHR

ellepero peroe at myumanitoba.ca
Tue Mar 25 23:13:01 CET 2014


Augusto:

I'm also looking to calculate hr overlap from MCP; however, I run into an
error in the code you provided:


Augusto Ribas wrote
> #calc sobreposition area
> for(i in 1:4){
>  for(j in 1:4){
>    p1 <- as(cp@'polygons'[[i]]@'Polygons'[[1]]@'coords','gpc.poly')
>    p2 <- as(cp@'polygons'[[j]]@'Polygons'[[1]]@'coords','gpc.poly')
>    res[i,j] <- area.poly(p1)+area.poly(p2)-area.poly(union(p1,p2))
>          }}
> res/10000

When I get to this point, the code produces an error, saying:
Error in as(hrmcp at polygons[[i]]@Polygons[[1]]@coords, "gpc.poly") :
  no method or default for coercing “matrix” to “gpc.poly”

Any ideas as to getting around this error?
Any feedback would be greatly appreciated!
Cheers,
Ellen 




--
View this message in context: http://r-sig-ecology.471788.n2.nabble.com/Estimating-HR-overlap-by-adehabitatHR-tp7409589p7578782.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.



More information about the R-sig-ecology mailing list