Organize data for the distance sampling model of Royle et al. (2004) fit by distsamp
Organizes count data along with the covariates and metadata.
This S4 class is required by the data argument of distsamp
unmarkedFrameDS(y, siteCovs=NULL, dist.breaks, tlength, survey, unitsIn, mapInfo)
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 |
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 |
.
mapInfo |
Currently ignored |
unmarkedFrameDS is the S4 class that holds data to be passed
to the distsamp
model-fitting function.
an object of class unmarkedFrameDS
If you have continuous distance data, they must be "binned" into discrete distance classes, which are delimited by dist.breaks.
Royle, J. A., D. K. Dawson, and S. Bates (2004) Modeling abundance effects in distance sampling. Ecology 85, pp. 1591-1597.
# 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
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.