Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/sample.points.R
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.
1 2 3 |
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 |
Definition for half-normal detection function (hndetfct) is exp(-(x^2/(2*exp(scale)^2)))
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
Jeff Laake
simCovariates
,simPts
,create.lines
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)
|
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, type ‘beginner’
Note: 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: ‘RandomFields’
The following object is masked from ‘package:RandomFieldsUtils’:
RFoptions
The following object is masked from ‘package: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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.