1

I am calculating a home range using the following data (extract)

x        y
437850.3 7220701
465101.3 7210903
489314.6 7159065
513795.7 7114472
532871.0 7075753

I use the following code to calculate home range, with my coordinates converted to UTM:

#Load packages
library(rgdal)
library(ks)
library(rgeos)
library(maptools)

#Project data into UTM
coordinates(data) <- c("x","y")
proj4string(data) <- CRS( "+proj=utm +zone=18 +datum=WGS84 +units=m +no_defs" )
data<-as.data.frame(data)

#Calculate plugin home range

h1 <- Hpi(data[,1:2], pilot = "samse", binned = T)
kernPI1 <- kde(data[,1:2], H = h1)
cont = contourLevels(kernPI1, cont = 95)
line = contourLines(x = kernPI1$eval.points[[1]], y =
                  kernPI1$eval.points[[2]], z = kernPI1$estimate,
                level = cont)
sldf = ContourLines2SLDF(line)
sldf = SpatialLines2PolySet(sldf)
sldf = PolySet2SpatialPolygons(sldf)

gArea(sldf) #result is 2010204962.

I am trying to calculate my area in km^2, and I know for a fact that my areas should be around 1000-10000 km^2. I am guessing this has to do with the UTM coordinates, but am not sure how to proceed beyond that.

Cam
  • 449
  • 2
  • 7
  • `dput(head(my_x and my_y))` would make this initial data easier to use. – Chris Jun 26 '22 at 06:14
  • Your area from `gArea()` is in square meters since UTMs are in meters. To get square kilometers: 2010204962/1e+06 = 2010.205. – dcarlson Jun 26 '22 at 14:13

0 Answers0