View source: R/create.varstructure.R
create.varstructure | R Documentation |
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.
create.varstructure(model, region, sample, obs, dht.se)
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? |
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.
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 |
Internal function called by dht
Jeff Laake
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.