create.varstructure: Creates structures needed to compute abundance and variance

View source: R/create.varstructure.R

create.varstructureR Documentation

Creates structures needed to compute abundance and variance

Description

Creates samples and obs dataframes used to compute abundance and its variance based on a structure of geographic regions and samples within each region. The intent is to generalize this routine to work with other sampling structures.

Usage

create.varstructure(model, region, sample, obs, dht.se)

Arguments

model

fitted ddf object

region

region table

sample

sample table

obs

table of object #'s and links to sample and region table

dht.se

is uncertainty going to be calculated later?

Details

The function performs the following tasks: 1)tests to make sure that region labels are unique, 2) merges sample and region tables into a samples table and issue a warning if not all samples were used, 3) if some regions have no samples or if some values of Area were not valid areas given then issue error and stop, then an error is given and the code stops, 4) creates a unique region/sample label in samples and in obs, 5) merges observations with sample and issues a warning if not all observations were used, 6) sorts regions by its label and merges the values with the predictions from the fitted model based on the object number and limits it to the data that is appropriate for the fitted detection function.

Value

List with 2 elements:

samples

merged dataframe containing region and sample info - one record per sample

obs

merged observation data and links to region and samples

Note

Internal function called by dht

Author(s)

Jeff Laake


mrds documentation built on March 18, 2022, 5:26 p.m.