prep_data: Prepares data and design data (ddl)

Description Usage Arguments Details Value

View source: R/prep_data.r

Description

prep_data: Certain variable names and values are hard coded and this prepares the data and ddl to make sure they are setup correctly and fixes specific real values in the ddl.

Usage

1
2

Arguments

data

dataframe containing double observer data with field ch (capture history), freq (optional), type ="u" (marked) or "c" (unmarked), count if more than one animal in each sighting. This is passed to process.data after checks.

model

either "Huggins" or "HugFullHet"

...

extra parameters passed to either process.data or make.design.data in RMark

dp

processed data passed to make.design.data after checks

Details

1) The data needs to contain a variable het which is constructed if not available in data, 2) A factor variable type with values "marked" and "unmarked" must be in data to define groups in data, 3) The encounter history named ch must be of type character with 3 characters each, 4) The model argument must be either Huggins or HugFullHet, and 5) The extra ... arguments are passed to process.data but cannot contains "groups" which is pre-specified.

prep_ddl: Prepares the ddl to make sure and fixes specific real values in the ddl. 1) for p and c parameters creates variable loc (for location) with values "Radio","Front" and "Rear" for 3 characters in ch, 2) for p and c parameters, creates a numeric variable "rear" which is 1 for loc=="Rear" and 0 otherwise, 3) creates variable fix for parameters p and c, to fix real parameter p to 1 for radio for type=="marked" and 0 for type="unmarked", 4) for HugFullHet model (pi in ddl), the pi for type=="unmarked" is set to 0 because that mixture has p=0 so by definition can't be in unmarked which only contain those seen, 5) for HugFullHet model (pi in ddl), set p=0 (except for Radio loc) for mixture because they cannot be seen by definition

Value

processed data list from prep_data and design data list (ddl) from prep_ddl


jlaake/DoubleObs documentation built on Dec. 21, 2021, 12:12 a.m.