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

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/sample.points.R

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

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

Arguments

transects

list of transect polygons

lines

dataframe of lines

points.ppp

simulated point process

detfct

detection function name

det.par

parameters for the detection function

det.formula

formula of covariates to use for scale of distance if det.formula=~-1, uses a strip transect

covariates

a matrix with columns x,y and any number of covariates x and y are the mid points of the grid cells; the order of the rows must match the formulation for function im

x

perpendicular distance for detection function

scale

scale for detection function

Details

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

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

Author(s)

Jeff Laake

See Also

simCovariates,simPts,create.lines

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)

Example output

Loading required package: spatstat
Loading required package: spatstat.data
Loading required package: nlme
Loading required package: rpart

spatstat 1.64-1       (nickname:Help you I can, yes!) 
For an introduction to spatstat, typebeginnerNote: spatstat version 1.64-1 is out of date by more than 7 months; we recommend upgrading to the latest version.
Loading required package: RandomFields
Loading required package: sp
Loading required package: RandomFieldsUtils

Attaching package:RandomFieldsThe following object is masked frompackage:RandomFieldsUtils:

    RFoptions

The following object is masked frompackage:nlme:

    Variogram

This is DSpat 0.1.6

New output format of RFsimulate: S4 object of class 'RFsp';
for a bare, but faster array format use 'RFoptions(spConform=FALSE)'.
Warning messages:
1: In `[<-`(`*tmp*`, i, value = gpc) :
  implicit list embedding of S4 objects is deprecated
2: In `[<-`(`*tmp*`, i, value = gpc) :
  implicit list embedding of S4 objects is deprecated
3: In `[<-`(`*tmp*`, i, value = gpc) :
  implicit list embedding of S4 objects is deprecated
4: In `[<-`(`*tmp*`, i, value = gpc) :
  implicit list embedding of S4 objects is deprecated
5: In `[<-`(`*tmp*`, i, value = gpc) :
  implicit list embedding of S4 objects is deprecated
6: In `[<-`(`*tmp*`, i, value = gpc) :
  implicit list embedding of S4 objects is deprecated
7: In `[<-`(`*tmp*`, i, value = gpc) :
  implicit list embedding of S4 objects is deprecated
8: In `[<-`(`*tmp*`, i, value = gpc) :
  implicit list embedding of S4 objects is deprecated
9: In `[<-`(`*tmp*`, i, value = gpc) :
  implicit list embedding of S4 objects is deprecated
10: In `[<-`(`*tmp*`, i, value = gpc) :
  implicit list embedding of S4 objects is deprecated

DSpat documentation built on May 2, 2019, 11:10 a.m.