estSpaceUse {track2KBA}R Documentation

Estimate the space use of tracked animals using kernel utilization distribution

Description

estSpaceUse is a wrapper for kernelUD which estimates the utilization distribution (UD) of multiple individuals or tracks in a tracking dataset.

Usage

estSpaceUse(tracks, scale, levelUD, res = NULL, polyOut = FALSE)

Arguments

tracks

SpatialPointsDataFrame. Must be projected into an equal-area coordinate system. If not, first run projectTracks.

scale

numeric (in kilometers). The smoothing parameter ('H') used in the kernel density estimation, which defines the width of the normal distribution around each location. The findScale function can assist in finding sensible scales.

levelUD

numeric (percent). Specify which utilization distribution contour at which to subset the polygon output. NOTE: This will only affect the output if polyOut=TRUE.

res

numeric (in square kilometers). Grid cell resolution for kernel density estimation. Default is a grid of 500 cells, with spatial extent determined by the latitudinal and longitudinal extent of the data.

polyOut

logical scalar (TRUE/FALSE). If TRUE then output will include a plot of individual UD polygons and a simple feature with kernel UD polygons for the level of levelUD. NOTE: creating polygons of UD is both computationally slow and prone to errors if the usage included in levelUD extends beyond the specified grid. In this case estSpaceUse will return only the estUDmobject and issue a warning.

Details

A utilization distribution will be calculated for each unique 'ID'. The data should be regularly sampled or interpolated (see adehabitatLT package for functions to this end).

If desired res results in memory-heavy grid (e.g. >10,000 cells) use polyOut = FALSE to speed things up.

Value

Returns an object of class estUDm which is essentially a list, with each item representing the utilization distribution of a level of 'ID'. Values in the output signify the usage probability per unit area for that individual in each grid cell. This can be converted into a SpatialPixelsDataFrame via the adehabitatHR::estUDm2spixdf function.

If polyOut=TRUE the output will be a list with two components: 'KDE.Surface' is the estUDm object and UDPolygons is polygon object of class sf (Simple Features) with the UD contour for each individual at the specified levelUD.

If polyOut=TRUE but the polygon delineation in adehabitatHR::getverticeshr fails, output is an object of class estUDm and a warning will be issued.

See Also

formatFields, tripSplit, findScale

Examples

library(sf)
library(sp)
library(magrittr)

## make some play data
dataGroup <- data.frame(
  Longitude = c(1, 1.01, 1.02, 1.04, 1.05, 1.03, 1), 
    Latitude =  c(1, 1.01, 1.02, 1.03, 1.021, 1.01, 1),
      ID = rep("A", 7),
        DateTime = format(
            lubridate::ymd_hms("2021-01-01 00:00:00") + 
              lubridate::hours(0:6)
                )
                )
                
tracks <- sf::st_as_sf(
   dataGroup, coords = c("Longitude", "Latitude"), 
   crs = 4326, agr = "constant") %>% 
   sf::st_transform(crs = 32631) %>% 
   sf::as_Spatial()

## estimate utilization distributions for each track
KDE <- estSpaceUse(tracks, scale=10, levelUD = 50)


[Package track2KBA version 1.1.1 Index]