Skip to contents

Mean Distance Travelled and Mean Dispersal Distance

Usage

sit_mdt(
  x,
  by = c("population", "age"),
  spatial_adjustment = TRUE,
  following_releases,
  following_days,
  species = NULL
)

Arguments

x

A sit object.

by

Character vector. Either 'population', or 'age', both (default), or NULL.

spatial_adjustment

Logical. Whether to adjust observations to account for a irregular spatial arrangement of traps.

following_releases

A sit_release object with a subset of release events or missing (default) for all point release events. Use in combination with following_days to filter surveys of the target populations within a given number of days after release. Note that counts of wild populations will always be included in the results with a value of NA in pop_col.

following_days

Integer or missing (default). Number of days after releases to return, if following_releases is not missing.

species

a character vector of species to be returned. Defaults to NULL, which ignores the species variable.

Value

By default (i.e. by = c('population', 'age')), a table with MDT computed for each released population at each age (i.e., number of days since release). If by is either one of the grouping variables, the results will be presented for each value of the corresponding variable. Finally, if by = NULL, all populations and ages are pooled together and the function returns a single number.

Examples

sit_mdt(sit_prototype)
#> 
#> ── Mean Distance Travelled ─────────────────────────────────────────────
#> 
#> 
#> population    age      mdt
#> -----------  ----  -------
#> blue            1   113.28
#> blue            2    48.51
#> blue            3    67.38
#> blue            4    71.98
#> blue            5   125.00
#> blue            6      NaN
#> blue            7   165.98
#> blue            8    38.66
#> blue            9      NaN
#> blue           10      NaN
#> blue           11   128.51
#> blue           12    37.38
#> blue           13   330.73
#> blue           14      NaN
#> blue           15    37.38
#> red             1    37.22
#> red             2    47.03
#> red             3    48.75
#> red             4    67.16
#> red             5    86.27
#> red             6    55.59
#> red             7   112.75
#> red             8   128.51
#> red             9    42.25
#> red            10   128.51
#> red            11      NaN
#> red            12      NaN
#> red            13      NaN
#> red            14   128.51
#> red            15    97.59
#> yellow          1    63.08
#> yellow          2    64.87
#> yellow          3    55.69
#> yellow          4    52.85
#> yellow          5    33.35
#> yellow          6   134.96
#> yellow          7      NaN
#> yellow          8    84.75
#> yellow          9   115.94
#> yellow         10      NaN
#> yellow         11      NaN
#> yellow         12      NaN
#> yellow         13      NaN
#> yellow         14      NaN
#> yellow         15      NaN
#> 
sit_mdt(sit_prototype, by = 'population')
#> 
#> ── Mean Distance Travelled ─────────────────────────────────────────────
#> 
#> 
#> population       mdt
#> -----------  -------
#> blue          110.08
#> red            63.48
#> yellow         69.35
#> 
sit_mdt(sit_prototype, by = 'age')
#> 
#> ── Mean Distance Travelled ─────────────────────────────────────────────
#> 
#> 
#>  age      mdt
#> ----  -------
#>    1    88.39
#>    2    51.75
#>    3    57.35
#>    4    68.11
#>    5   109.28
#>    6    79.75
#>    7   154.33
#>    8    79.38
#>    9   104.39
#>   10   128.51
#>   11   128.51
#>   12    37.38
#>   13   330.73
#>   14   128.51
#>   15    76.27
#> 
sit_mdt(sit_prototype, by = NULL)
#> 
#> ── Mean Distance Travelled ─────────────────────────────────────────────
#> 
#>  Estimated average value: 85.17
#>