| read.inp {openCR} | R Documentation |
Import Data from RMark Input Format
Description
read.inp forms a capthist object from a MARK input (.inp) file.
Usage
read.inp(filename, ngroups = 1, grouplabel = 'group', grouplevels = NULL,
covnames = NULL, skip = 0)
Arguments
filename |
character file name including ‘.inp’. |
ngroups |
integer number of group columns in input |
grouplabel |
character |
grouplevels |
vector with length equal to number of groups |
covnames |
character vector of additional covariates names, one per covariate column |
skip |
integer number of lines to skip at start of file |
Details
Comments bracketed with ‘/*' and '*/’ will be removed automatically.
If grouplevels is specified then ngroups is taken from the number of levels (ngroups is overridden). An individual covariate is output, named according to grouplabel. The order of levels in grouplevels should match the order of the group frequency columns in the input. This also determines the ordering of levels in the resulting covariate.
Value
A single-session capthist object with no traps attribute.
See Also
Examples
datadir <- system.file('extdata', package = 'openCR')
dipperCH <- read.inp(paste0(datadir, '/ed.inp'), ngroups = 2)
summary(dipperCH)