Description Usage Arguments Details Value Author(s) References Examples

View source: R/addObservations.R

This function takes a `formLatticeOutput`

object, which encodes a region
possibly with and irregular boundary and holes, and adds point process
observations. The observations should be in the form of a matrix or
data frame. `addObservations`

is used when the aim is to produce
a density map from a point process. If, instead, you wish to produce
a nonparametric regression surface given responses and their locations, you
should use `addQuantVar`

instead.

1 | ```
addObservations(formLatticeOutput, observations)
``` |

`formLatticeOutput` |
An object returned by formLattice or editLattice. |

`observations` |
A matrix or data frame with two columns. |

Every node in the `formLatticOutput`

object is assigned an initial density
that is equal to the fraction of all observations that are nearest to that
node. Note that this means observations can be outside the boundary of the
region of interest - they will just be associated with the nearest node inside
the region. The function returns a vector equal in length to the number of
nodes that has the initial density for each node. This vector corresponds to
*p_0*, the inital probability vector as in Barry and McIntyre (2011).

a list with two elements.

init_probNumerical vector with the initial probability distribution

which_nodesvector of nodes to which observations were assigned

Ronald P. Barry

Ronald P. Barry, Julie McIntyre. Estimating animal densities and home range in regions with irregular boundaries and holes: A lattice-based alternative to the kernel density estimator. Ecological Modelling 222 (2011) 1666-1672. <doi:10.1016/j.ecolmodel.2011.02.016>

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
plot.new()
data(polygon1)
#
nodeFillingOutput <- nodeFilling(poly=polygon1, node_spacing=0.01)
plot(nodeFillingOutput)
formLatticeOutput <- formLattice(nodeFillingOutput)
plot(formLatticeOutput)
#
Pointdata <- splancs::csr(polygon1,30)
Pointdata <- Pointdata[Pointdata[,1]<0.5,]
colnames(Pointdata) <- c("x","y")
plot(polygon1,type="n")
polygon(polygon1)
points(Pointdata,pch=19)
#
densityOut <- createDensity(formLatticeOutput,PointPattern=Pointdata,
k=40,intensity=FALSE, sparse = TRUE)
plot(densityOut)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.