unmarkedFrameDS: Organize data for the distance sampling model of Royle et al....

Description Usage Arguments Details Value Note References See Also Examples

View source: R/unmarkedFrame.R

Description

Organizes count data along with the covariates and metadata. This S4 class is required by the data argument of distsamp

Usage

1
2
unmarkedFrameDS(y, siteCovs=NULL, dist.breaks, tlength, survey,
    unitsIn, mapInfo)

Arguments

y

An RxJ matrix of count data, where R is the number of sites (transects) and J is the number of distance classes.

siteCovs

A data.frame of covariates that vary at the site level. This should have R rows and one column per covariate

dist.breaks

vector of distance cut-points delimiting the distance classes. It must be of length J+1.

tlength

A vector of length R containing the trasect lengths. This is ignored when survey="point".

survey

Either "point" or "line" for point- and line-transects.

unitsIn

Either "m" or "km" defining the measurement units for both dist.breaks and tlength

.

mapInfo

Currently ignored

Details

unmarkedFrameDS is the S4 class that holds data to be passed to the distsamp model-fitting function.

Value

an object of class unmarkedFrameDS

Note

If you have continuous distance data, they must be "binned" into discrete distance classes, which are delimited by dist.breaks.

References

Royle, J. A., D. K. Dawson, and S. Bates (2004) Modeling abundance effects in distance sampling. Ecology 85, pp. 1591-1597.

See Also

unmarkedFrame-class, unmarkedFrame, distsamp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Fake data
R <- 4 # number of sites
J <- 3 # number of distance classes

db <- c(0, 10, 20, 30) # distance break points

y <- matrix(c(
   5,4,3, # 5 detections in 0-10 distance class at this transect
   0,0,0,
   2,1,1,
   1,1,0), nrow=R, ncol=J, byrow=TRUE)
y

site.covs <- data.frame(x1=1:4, x2=factor(c('A','B','A','B')))
site.covs

umf <- unmarkedFrameDS(y=y, siteCovs=site.covs, dist.breaks=db, survey="point",
    unitsIn="m")            # organize data
umf                         # look at data
summary(umf)                # summarize
fm <- distsamp(~1 ~1, umf)  # fit a model

unmarked documentation built on May 27, 2021, 5:07 p.m.