truncdat: Data truncation.

View source: R/utils.R

truncdatR Documentation

Data truncation.

Description

Left- and/or right-truncates any variable in data frame dat, inserting effort-only record if truncation removes all detections on a transect. Subtracts left-trunction point off all variable values - after all truncation.

Usage

truncdat(
  dat,
  minval = 0,
  maxval = NULL,
  twosit = FALSE,
  colnames = c("stratum", "area", "transect", "L", "x", "obs")
)

Arguments

dat

distance data frame. Must have columns for stratum stratum.area, transect, transect.length, <any-observer-level_variable>, and if twosit==TRUE then object as well. These can have any names, but the names must be specified, via argument colnames.

twosit

If TRUE, assumes this is an mrds-type dataset with two lines per detection.

colnames

name of columns containing stratum, stratum area, transect, transect length, <any-observer-level_variable>, and if twosit==TRUE then object as well, IN THIS ORDER, in a character vector. The default value is colnames=c("stratum","area","transect","L","x","obs").

minvalue

left-truncation point.

maxvalue

right-truncation point.


david-borchers/hmltm documentation built on Oct. 29, 2023, 9:07 p.m.