title: error in KernelUD "at least 5 relocations are required to fit a home range"
body: <p>I have a dataset of bat movement data in the form of polygons. I have created one random point per polygon and looped this to run 100 times. This has created a data frame where each individual bat has 100 loopnos. I am trying to create a kernelUD for each loopno, stack them per individual and then average them using the following script. This works when I use the full dataset. However when I subsample it I get the error that "at least 5 relocations are required to fit a home range". Please could someone advise me the best way to check how many relocations I have per loopno and or individual please?</p>
  
  <pre><code>library(adehabitatHR)
  library(raster)
  library(maptools)
  library(stats)
  
  setwd("C:/Users/a6915409/Dropbox/Paper write up")
  
  
  # read in bat master
  bat.master&lt;- read.csv("./original csv files/LCfirsthalf09.09.csv")
  
  #make bat.points spatial data
  xy &lt;- bat.master[2:3]#first two rows save as coords
  df &lt;- bat.master [-1:-4]#remove unneded columns for ud
  df&lt;-df[-2]
  
  SPDF &lt;- SpatialPointsDataFrame(coords=xy, data=df)#combine df and xy
  
  #read in landcover data for habitat grid
  r &lt;- raster("landcover.asc")
  
  #need to set up graphical parametrs
  par(mfrow=c(2,1))
  par(mar=c(0,0,2,0))
  g &lt;- as(r, 'SpatialGridDataFrame')
  p &lt;- as(r, 'SpatialPixelsDataFrame')
  habitat&lt;-p
  
  #chnage spatial projections so they match
  proj4string(SPDF)&lt;-proj4string(habitat)
  
  #split bat master by ID into a list of spatial dataframes each with 100 replicates 
  pts1&lt;-split(SPDF , bat.master$id)
  
   ## generate uds on each animal for each loop
  pts2 &lt;- lapply(pts1, function(x) {slot(x, "data") &lt;- data.frame(x@data   [,1]); return(x)})
  
  ############################################################## Works up to  here
  
  
    uds&lt;- lapply(pts2, function(x) kernelUD(x, h=200, grid=habitat))#flags an error "at least 5 relocations are required to fit an home range"
  
  #stack the ud's as raster layers, 100 for each animal
  
  udsr &lt;- lapply(uds, function(x) stack(lapply(x, raster)))
  
  
  ## take the mean
  udsm &lt;- lapply(udsr, mean)
  
  for (i in seq_along(udsm)) {
    uds[[i]]&lt;- uds[[i]][[1]]
    uds[[i]]@grid &lt;- as(udsm[[i]], "GridTopology")
  }
  
  
  class(uds)&lt;-"estUDm"
  </code></pre>