# NOT RUN {
##modified example from ?distsamp
# }
# NOT RUN {
if(require(unmarked)){
data(linetran)
##format data
ltUMF <- with(linetran, {
unmarkedFrameDS(y = cbind(dc1, dc2, dc3, dc4),
siteCovs = data.frame(Length, area, habitat),
dist.breaks = c(0, 5, 10, 15, 20),
tlength = linetran$Length * 1000, survey = "line",
unitsIn = "m")
})
##compute descriptive stats from data object
countDist(ltUMF)
##Half-normal detection function
fm1 <- distsamp(~ 1 ~ 1, ltUMF)
##compute descriptive stats from model object
countDist(fm1)
}
# }
Run the code above in your browser using DataLab