Learn R Programming

DSpat (version 0.1.0)

sample.points: Sample points within each transect and filter with specified detection function

Description

Create a dataframe of observations by simulating distance sampling of a point process with a systematic set of lines over a rectangular grid. The transects, lines and point process(points.ppp) are input arguments. Detection of observations is specified with a user-defined detection function which takes a distance vector and set of parameters det.par as its arguments.

Usage

sample.points(transects,lines,points.ppp,detfct=NULL,det.par=NULL,
                      det.formula=~1,covariates=NULL)
hndetfct(x,scale)

Arguments

Value

observation dataframe with fields label,x,y,distance for line label, x,y coordinates of the observation location and its perpendicular distance from the line

Details

Definition for half-normal detection function (hndetfct) is exp(-(x^2/(2*exp(scale)^2)))

See Also

simCovariates,simPts,create.lines

Examples

Run this code
study.area=owin(xrange=c(0,100),yrange=c(0,100))
hab.range=30
probs=c(1/3,2/3)
covariates = simCovariates(hab.range, probs)
xlines=create.lines(study.area,nlines=10,width=5,angle=45)
ls=lines_to_strips(xlines,study.area)
plot(ls$lines,lty=2)
plot(owin(poly=ls$transects),add=TRUE)
xpp=simPts(covariates=covariates,int.formula=~factor(habitat),int.par=c(0,1,2),EN=1000)
obs=sample.points(transects=ls$transects,lines=xlines,points.ppp=xpp,
                    hndetfct,c(1),covariates=covariates)
plot(ppp(x=obs$x,y=obs$y,window=study.area),add=TRUE,pch=20)

Run the code above in your browser using DataLab