getModelFile: Create a sparta JAGS model file fitting your needs

View source: R/getModelFile.R

getModelFileR Documentation

Create a sparta JAGS model file fitting your needs

Description

This function is primarily for internal use within occDetFunc. It is used to write a model file that fits the users needs, the path to this file is returned.

Usage

getModelFile(
  modeltype,
  regional_codes = NULL,
  region_aggs = NULL,
  verbose = FALSE
)

Arguments

modeltype

Character, see occDetFunc for more information.

regional_codes

A data.frame object detailing which site is associated with which region. each row desginates a site and each column represents a region. The first column represents the site name (as in site). Subsequent columns are named for each regions with 1 representing the site is in that region and 0 that it is not. NOTE a site should only be in one region

region_aggs

A named list giving aggregations of regions that you want trend estimates for. For example region_aggs = list(GB = c('england', 'scotland', 'wales')) will produced a trend for GB (Great Britain) as well as its constituent nations. Note that 'england', scotland' and 'wales' must appear as names of columns in regional_codes. More than one aggregate can be given, eg region_aggs = list(GB = c('england', 'scotland', 'wales'), UK = c('england', 'scotland', 'wales', 'northern_ireland')).

verbose

Logical, if true progress is reported to the console

Value

The path to the model file.


BiologicalRecordsCentre/sparta documentation built on April 22, 2024, 2:34 p.m.