Kernel Density using adeHabitatHR

Hi all, trying to to create kernel densities from a set of lat and long data. I have been getting an error:
Error in proj4string<-(*tmp*, value = CRS(pfs)) :
Geographical CRS given to non-conformant data: -105.246688983
In addition: Warning messages:
1: In proj4string(x) :
CRS object has comment, which is lost in output; in tests, see
https://cran.r-project.org/web/packages/sp/vignettes/CRS_warnings.html
2: In proj4string(x) :
CRS object has comment, which is lost in output; in tests, see
https://cran.r-project.org/web/packages/sp/vignettes/CRS_warnings.html

I can't find how to address this error to move forward. Any help is appreciated. My data looks like this:
lat lon

My code looks like this:
HP <- read_csv("~/Desktop/HPIIlat:lon.csv")
HP.kde<- HP[, c("id", "lat", "lon")]
write.csv(HP.kde, "HP_kde.csv")
view(HP.kde)
HP.kde= read.csv("HP_kde.csv", stringsAsFactors = FALSE)

HP.kde= HP.kde[!is.na(HP.kde$lat) & !is.na(HP.kde$lon),]
names(HP.kde)[names(HP.kde) == "lat"]<- "x"
names(HP.kde)[names(HP.kde) == "lon"]<- "y"
glimpse(HP.kde)
coordinates(HP.kde)<- c("x", "y")
proj4string(HP.kde)<- CRS("+proj=longlat +datum=WGS84")

kernel = kernelUD(HP.kde, h= "href")
image(kernel)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.