createRoster: 'createRoster' - Specify how to filter the occupancy model...

View source: R/createRoster.R

createRosterR Documentation

createRoster - Specify how to filter the occupancy model outputs.

Description

This function can be used to specify the filters that will be applied to the occupancy model outputs using applyFilters. It works by creating a list of 1-row dataframes with all the information needed for applyFilters. This list is then applied to the applyFilters function later. Arguments should be provided as vectors of equal length, with each element in the vectors corresponding to one call to applyFilters.

Usage

createRoster(
  index,
  modPath = "/data-s3/occmods/",
  metaPath,
  ver = "most_recent",
  group,
  indicator,
  region,
  nSamps = 1000,
  minObs = 50,
  write,
  outPath,
  clipBy = "species",
  t0,
  tn
)

Arguments

index

Numeric. Index of the number of taxonomic groups to applyFilters across.

modPath

A character string or vector of strings. Location(s) of the occupancy model outputs.

metaPath

A character string or vector of strings. Location(s) of the occupancy model metadata.

ver

A character string or vector of strings. Which set of occupancy model outputs to use? Can be manually specified e.g. Charlie's are "2017_Charlie"; or to source the most recent model versions use "most_recent" (default), which uses model metadata stored at "/data-s3/most_recent_meta" to identify the most recent model version per taxonomic group.

group

A character string or vector of strings. Taxonomic group(s), e.g. "Ants"

indicator

A character string or vector of strings. Whether or not to subset species and, if so, based on what. Options are: "priority" for priority species; "pollinators" for pollinators; and all to return all species in the group.

region

A character string or vector of strings. One of "UK", "GB", "ENGLAND", "WALES", "SCOTLAND", or "NORTHERN.IRELAND" per taxonomic group.

nSamps

Numeric or numeric vector. Number of samples to extract from each species' posterior distribution.

minObs

Numeric or numeric vector. Threshold number of observation below which a species is dropped from the sample.

write

Logical or logical vector. If TRUE then the outputs are written as a .rdata file to outPath.

outPath

A character string or vector of strings. Location to store the outputs if write = TRUE.

clipBy

A character string or vector of strings. One of "species" or "group" indicating whether to clip outputs by the first and last years of data for each species or for the whole group, respectively.

Value

A list of 1-row dataframes containing all arguments needed for applyFilters. applyFilters can then be applied to this list to filter models outputs for different taxonomic groups, which may come from different rounds (e.g. Charlie's or later), for different regions, etc.


robboyd/wrappeR documentation built on Nov. 18, 2022, 10:30 a.m.