Skip to content
Prev 19942 / 29559 Next

mcp calculation

Hi,
On Fri, Dec 6, 2013 at 4:04 PM, Lutfor <rahmannorthampton at gmail.com> wrote:
I have no idea who Mathieu is: you sent this message to the entire
r-sig-geo list, if by way of the horrid nabble "interface."
You don't say, but I'm assuming you are using the package
adehabitatHR. It's very important to tell us where you get your
functions from.

If you read the help for mcp.area, you will see:

Arguments

xy An object inheriting the class SpatialPoints containing the x and y
relocations of the animal. If xy inherits the class
SpatialPointsDataFrame, it should contain only one column (a factor)
corresponding to the identity of the animals for each relocation.

So yes, you need a Spatial object. There are other advantages to
Spatial objects, though.

This might be a slightly less convoluted approach:
mcpdata1 <-  structure(list(Stage = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L), .Label = "incubation", class = "factor"), x = c(646395.1,
646395.1, 646395.1, 646395.1, 646382.9, 646395.1, 646238.7, 646531.6,
646408, 646395.1, 646395.1), y = c(5213765L, 5213765L, 5213765L,
5213765L, 5213765L, 5213765L, 5213946L, 5213897L, 5213765L, 5213765L,
5213765L)), .Names = c("Stage", "x", "y"), class = "data.frame",
row.names = c(NA,
-11L))

library(adehabitatHR)

rel2 <- mcpdata1
coordinates(rel2) <- ~x + y

cp2 <- mcp(rel2, percent=100)
mcp.area(rel2)

Sarah