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 applySamp. It works by creating a list of 1-row dataframes with all the information needed for applySamp. This list is then applied to the applySamp function later. Arguments should be provided as vectors of equal length, with each element in the vectors corresponding to one call to applySamp.

Usage

createRoster(
  index,
  modPath = "/data-s3/occmods/",
  metaPath,
  ver = "most_recent",
  group,
  indicator,
  region,
  nSamps = 999,
  minObs = 50,
  scaleObs = "global",
  write,
  outPath,
  speciesToKeep = NA,
  drop = TRUE,
  clipBy = "group",
  t0,
  tn
)

Arguments

index

Numeric. Index of the number of taxonomic groups to applySamp 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.

scaleObs

A character string or vector of strings. At what scale to assess the number of observations? One of "region" to assess the number of observations at the chosen regional scale or "global" to assess the total number of observations for the species.

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.

speciesToKeep

A character vector of strings. the names of species to include, this is used in combination with 'indicator'. ONLY species on both lists will be included in the output.

drop

Logical or logical vector. If TRUE then species are dropped based on scheme advice complied by Charlie Outhwaite

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 applySamp. applySamp 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.


BiologicalRecordsCentre/wrappeR documentation built on May 3, 2023, 2:36 a.m.