0

I am trying to perform the simple task of estimating a kernel density utilisation distribution across the foraging tracks of all females in my data set (just a visualisation exercise), and have opted for the kernelUD function within the adehabitatHR package in R.

I can set up a simple example of the SpatialPoints object I have been working with, which is formatted in long-lat format.

female <- filter(tracks, Sex == "Female") 

# check the range of the longitude and latitude
range(female[,c("Latitude")])
[1] 20.71389 84.20619
range(female[,c("Longitude")])
[1] -23.85262 105.20330

# make the SpatialPoints object
sp.female <- SpatialPoints(coords = female[,c("Longitude", "Latitude")],
                                    proj4string = CRS("+proj=longlat +ellps=WGS84"))

So no points are outside of the expected range for either longitude or latitude, but when I then try and perform the kernelUD:

kd.female <- kernelUD(sp.female, h = "href")
Error in `proj4string<-`(`*tmp*`, value = CRS(pfs1)) : 
  Geographical CRS given to non-conformant data: -105.076705907

This data point does not appear in the object I am working with, so I am at a loss as to how to troubleshoot the error.

I'm running the following package versions on R v3.6.3

> packageVersion('adehabitatHR')
[1] ‘0.4.19’
> packageVersion('rgdal')
[1] ‘1.5.23’
> packageVersion('sp')
[1] ‘1.4.5’

Thanks in advance for any help.

HammerKop
  • 17
  • 4

1 Answers1

0

I have found that transforming to UTM appears to fix the problem, but I would be keen to know why the kernelUD function does not work on data where the coordinates are formatted in classic longitude and latitude.

HammerKop
  • 17
  • 4