我一直在按人口和每个包在各种时间尺度上对一个地区的犬科动物群体进行内核密度家庭范围估计。但是,当我尝试在每年的一个子集上运行 kernelUD 时,我得到Error in kernelUD(P17.sp[, "Pack"], h = "href", grid = 500, same4all = TRUE) : At least 5 relocations are required to fit an home range
. 我之前消除了所有重定位数少于 5 的组,当我仔细检查我的数据框时,最小的重定位数是 201。我能够在每包的全球数据集(跨年)上运行它并且没有问题。任何帮助或见解将不胜感激。
我使用的代码如下。我的原始数据框有 Pack 作为因子(并且是数据框中唯一的因子向量)和纬度/经度的数字坐标。
library(dplyr)
library(raster)
library(sp)
library(adehabitatHR)
library(lubridate)
library(data.table)
# Make spatial
Final.sp <- copy(Final)
coordinates(Final.sp) <- c("Longitude", "Latitude")
proj4string(Final.sp) <- CRS( "+init=epsg:4326")
#Subset by year
P17.sp <- Final.sp[Final.sp@data$Year == 2017, ]
# Make sure every pack has at least 5 relocations
P17 <- as.data.frame(P17.sp)
P17 %>% group_by(Pack) %>% summarise(n()) %>% view()
# What the output from above looks like
Year Pack n()
#1 2017 Gryffindor 201
#2 2017 Slytherin 222
#3 2017 Hufflepuff 234
#4 2017 Ravenclaw 281
#5 2017 Deatheaters 306
#6 2017 Muggles 577
#7 2017 Dementors 582
#8 2017 Hobbits 787
#9 2017 Elves 861
#10 2017 Orcs 914
# Create KDEs
P17.kde <- kernelUD(P17.sp[,"Pack"], h="href", grid=500, same4all = TRUE)
Error in kernelUD(WP17.sp[, "Pack"], h = "href", grid = 200, same4all = TRUE) :
At least 5 relocations are required to fit an home range```