StackFilter: StackFilter - clip and filter stacked estimates produced by...

Usage Arguments Value

View source: R/StackFilter.R

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
StackFilter(
  input = "memory",
  indata,
  output_path,
  group_name,
  metadata,
  region = NULL,
  minObs = NULL,
  maxStartGap = NULL,
  maxEndGap = NULL,
  maxMiddleGap = NULL,
  keepSpecies = NULL,
  removeSpecies = NULL,
  ClipFirst = FALSE,
  ClipLast = FALSE
)

Arguments

indata

The file path to the .rdata file produced using SampBind().

output_path

The file path to the folder in which the filtered stack should be saved.

group_name

Name used for the output file

metadata

Metadata detailing the information on which filtering is required for each species. This is produced using ExtractMetadata(). Metadata can be produced by the user but the required columns must be included:

  • Species - needed for all filters. The name of the species. Must match those in the indata

  • minObs - needs n_obs

  • maxStartGap - needs gap_start

  • maxEndGap - needs gap_end

  • maxMiddleGap - needs middle_gap

  • ClipFirst - needs min_year_model and min_year_data

  • ClipLast - neeeds max_year_model and max_year_data

If region is not NULL all columns must be suffixed with "_r_region" e.g. n_obs_r_ENGLAND if the posterior samples are the values for the region ENGLAND from a model with multiple regions.

region

The name of the focal region if estimates are for one region from a regional model. This must exactly match the region name used in the model.

minObs

The threshold number of observations a species must have. Species with fewer observations are removed by this filter.

maxStartGap

The maximum number of years allowed between the first model estimate and the first observation.

maxEndGap

The maximum number of years allowed between the last observation and the last model estimate.

maxMiddleGap

The maximum number of consecutive years allowed between the first and last observations in which the focal species was not observed.

keepSpecies

A vector of species names that match those in indata. All other species will be removed from the data.

removeSpecies

A vector of species names that match those in indata. These species will be removed from the data.

ClipFirst

Whether to clip all species time series to begin in the year of their first observation.

ClipLast

Whether to clip all species time series to end in the year of their last observation.

Value

This function will save an .rdata file containing the stacked estimates after the specified filters.


GPowney/TrendSummaries documentation built on Nov. 15, 2021, 6:14 p.m.