[R] Help with Error Messages

Jackson Hooten jlhooten at eckerd.edu
Wed Dec 7 18:53:56 CET 2016


Hello everyone,
I am new to R and need help with a project I am currently running. I am
tracking about 24 great white sharks in Mossel Bay South Africa. I wish to
summarize these sharks' movements in and around the bay. In order to do
that I have a shapefile of a map that I wish to import into R and use as a
base layer to show the movements of the sharks. I have been searching
everywhere online, but cannot seem to find anything that can show me how to
import such a shapefile. Any advise?

On top of that, I also wish to do a kernel density estimation of these
sharks' movements on the map. My data consists of "x" and "y" (Latitude and
Longitude) coordinates of where the sharks pinged, the date, and their ID.
So far, I have been able to figure out some codes that will get me what I
need as far as the kernel density estimations go.

Code example:
> kud.href<-kernelUD(shark.sp[,"id"], h="href", hlim=c(0.01,0.5), grid=500,
extent=0.1)
> image(kud.href,col=rev(heat.colors(50)))

However, whenever I run this code:
> kud95<-getverticeshr(kud,percent=95)
I get this error message:
Error in getverticeshr.estUD(x[[i]], percent, ida = names(x)[i], unin,  :
  The grid is too small to allow the estimation of home-range.
You should rerun kernelUD with a larger extent parameter

Could anyone advise me on how to solve this problem? I have already tried
to increase the "grid" as well as the "extent parameter" but continuously
get this same error message. I read online somewhere, that one could use
the "SpatialPixels" function to solve the problem, but they never put an
example up, so I have no idea how to apply it. Thank you so much for your
patience and assistance.

Sincerely,
Jackson

	[[alternative HTML version deleted]]



More information about the R-help mailing list