I am trying to analyze spatial data in R. I ran into problems trying to subset my data for the analysis. First of all my raw data had this format. The Dataframe is called "locs":
AnID X Y
1 Ind7 408046.3 5508986
2 Ind7 407445.4 5508927
3 Ind7 407588.2 5508927
4 Ind7 407595.9 5508819
5 Ind7 408079.9 5508904
It contains the coordinates for seven different animals (Ind1-Ind7). When i turned it into SpatialPointsDataFrame and used the head(locs)
command I got this:
AnID
1 Ind7
2 Ind7
3 Ind7
4 Ind7
5 Ind7
6 Ind7
So as you can see all the coordinates are gone. I try to subset the data so that only the rows of Ind3 are available.
Animal3 <- locs[as.data.frame(locs)[,1]=="Ind3",]
When i plot this data i can see all 75 locations perfectly but when i use the following command i get an error:
kernelUD(Animal3, h=293, grid=ab)
The error says:
Error in `kernelUD(Animal3, h = 293, grid = ab)` :
At least 5 relocations are required to fit an home range