boot_area: Cumulative analysis of collective areas by bootstrapping

View source: R/boot_area.R

boot_areaR Documentation

Cumulative analysis of collective areas by bootstrapping

Description

Function to calculate collective areas (merged x% Utilisation Distributions or UDs) of n individuals by bootstrapping.

Usage

boot_area(
  data,
  cell.size = NA,
  R = 1000,
  percent = 50,
  quantiles = c(0.25, 0.5, 0.75)
)

Arguments

data

A matrix or list of RasterLayer/SpatRaster objects. Each row of the matrix or each RasterLayer/SpatRaster object contains a utilisation distribution (or other statistics that sums to 1 - e.g. proportion of time spent). The grid size and geographical extent must be consistent across each row of the matrix or each RasterLayer/SpatRaster object. The function assumes that each column of the matrix is associated with a unique geographical location or that each RasterLayer/SpatRaster has exactly the same geographical extent and resolution.

cell.size

A numeric value specifying the grid cell size of the input data in metres.

R

An integer specifying the number of iterations. A larger R is required when the sample size is large. R > sample size x 100 is recommended (e.g. R > 1000 for a sample size 10).

percent

An integer specifying the percent volume of each UD to be considered in the analysis.

quantiles

A vector or a number to specify the quantiles to be calculated in the summary of the results.

Details

This function calculates collective areas (e.g. 50% UDs) of 1 to n individuals by bootstrapping.

Value

A list containing two data frames - raw results and summary (mean, sd, sem and quantiles at each sample size).

Author(s)

Takahiro Shimada

References

Shimada T, Thums M, Hamann M, Limpus CJ, Hays GC, FitzSimmons N, Wildermann NE, Duarte CD, Meekan MG (2021) Optimising sample sizes for animal distribution analysis using tracking data. Methods in Ecology and Evolution 12(2):288-297 \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/2041-210X.13506")}

See Also

boot_overlap, combn_overlap

Examples

## Not run: 

#1 Utilisation distributions of flatback turtles (n = 15).
data(ud_raster)

#2 Calculate collective areas from 3000 random permutation
area <- boot_area(ud_raster, R = 3000, percent = 50)

#3 Find the minimum sample size required to estimate the general distribution.
a <- asymptote(area, upper.degree = 10, estimator = 'glm', family = gaussian, max.asymptote = NA)

#4 Plot the mean collective area and rational function fit relative to the sample sizes.
ggplot(data = a$results, aes(x = x))+
  geom_pointrange(aes(y = y, ymin = y_lwr, ymax = y_upr)) + 
  geom_point(aes(y = y), size = 2) + 
  scale_x_continuous(breaks = seq(0, 15, 3), limits = c(2,15), name = "Animals tracked (n)") +
  scale_y_continuous(name = expression(Area~(km^2)), labels=function(x) x/1e6)

## End(Not run)

TakahiroShimada/SDLfilter documentation built on Nov. 15, 2023, 10:01 p.m.