# Load the example datasets for sparrow detections and transects from package
data(sparrow.detections)
data(sparrow.transects)
# Compute perpendicular, off-transect distances from the observer's sight distance and angle
sparrow.detections$dist <- perp.dists(obs.dist=sparrow.detections$sightdist,
obs.angle=sparrow.detections$sightangle)
# Fit detection function object
dfunc <- F.dfunc.estim(sparrow.detections, w.hi=150)
# Estimate abundance given a detection function
# Note, area=10000 converts to density per hectare (for distances measured in meters)
# Note, a person should do more than R=20 iterations
fit <- F.abund.estim(dfunc, detection.data=sparrow.detections, transect.data=sparrow.transects,
area=10000, R=20, ci=0.95, plot.bs=TRUE)
Run the code above in your browser using DataLab