In points2grid(points, tolerance, round) : cell size from constant coordinate 1 possibly taken from other coordinate

Viewed 9

I'm pretty new with R and am having a difficult time finding out the reason for this warning message shown above. I believe it is causing an error in a future line of code. I was able to run my data with an mcp but the warning and error appear when trying to use function kernelUD.

Here is the code: #Load packages library(adehabitatHR) library(sp) library(rgdal)

#Open datasets
NOBO<-read.csv("S123_Oct21-Apr22_WinteringHR.csv")
head(NOBO)

#Create spatial points
NOBO_sp<-SpatialPoints(NOBO[,3:4], proj4string = CRS("+proj=utm +zone=16S +datum=WGS84"))
NOBO_spdata<-SpatialPointsDataFrame(NOBO[,3:4], NOBO, proj4string = CRS("+proj=utm +zone=16S 
+datum=WGS84"))

#Convert to UTMS ##Bobwhite Data already in UTMS
#NOBO_sp<-spTransform(...)
#NOBO_spdata<-spTransform(...)

## multiple convex polygons (mcp)
?mcp

#mcp of the whole population
mcp_all<-mcp(NOBO_sp, percent = 95, unin = "m", unout ="ha")
mcp_core<-mcp(NOBO_sp, percent = 50, unin = "m", unout ="ha")
plot(mcp_all, border="blue", lwd=2)
plot(NOBO_sp, add=T) #region too large
plot(mcp_core, border="red", lwd=2, add=T)
mcp_all

#mcp at the individual level
mcp_ind<-mcp(NOBO_spdata[,2], percent=95, unin="m", unout="ha")
mcp_ind
plot(mcp_all, border="blue", lwd=2)
plot(mcp_ind, border="red", lwd=2, add=T)

###Switching to kernel
?kernelUD

kern_all<-kernelUD(NOBO_sp, h="href", grid=295)
image(kern_all)
kern_all<-kernelUD(NOBO_sp, h="href", grid=20)
plot(kern_all)
kern_all
str(kern_all) # h value is 295

#Move to delineation
?getverticeshr
kern95_all<-getverticeshr(kern_all, percent = 95, unin = "m", unout = "ha")
plot(kern95_all)
kern95_all #HR area=1100.982 ha

... and here is the data I'm working with https://docs.google.com/spreadsheets/d/1r4hjHifhCawTTB5UHkdvyK_ySFYxvbLG/edit?usp=sharing&ouid=115305148931308358191&rtpof=true&sd=true

Thanks in advance for any advice

0 Answers
Related