View source: R/ppmlasso/R/ppmlasso_functions.R View source: R/ppmlasso_functions.R
ppmdat | R Documentation |
This function prepares the data for model fitting. In particular, it determines observation weights and sets up the design matrix required for fitting a regularisation path.
ppmdat(sp.xy, sp.scale, back.xy, coord = c("X","Y"), sp.dat = getEnvVar(sp.xy = sp.xy,
env.scale = sp.scale, env.grid = back.xy, coord = coord, writefile = writefile),
sp.file = NA, quad.file = NA, datfilename = "PPMDat", writefile = TRUE)
sp.xy |
A matrix of species locations containing at least one column representing longitude and one column representing latitude. |
sp.scale |
The spatial resolution at which to sample quadrature points. |
back.xy |
The geo-referenced matrix of environmental grids. |
coord |
A vector containing the names of the longitude and latitude coordinates, as
in |
sp.dat |
A matrix of species presence locations and the corresponding environmental
data, as generated by |
sp.file |
The name of a saved file containing a matrix of species presence locations
and the corresponding environmental data, as generated by |
quad.file |
The name of a fie containing the quadrature points created from the
|
datfilename |
An optional argument containing the name of the saved file. Setting
|
writefile |
A logical argument to determine whether the output should be written to a file or not. If |
This function will call the sampleQuad
and getEnvVar
functions to generate a quadrature scheme and interpolate environmental data to presence
locations. Alternatively, the quadrature scheme may be directly supplied to the
quad.file
argument, and the matrix of presence locations and associated environmental
data may be directly supplied to either the sp.dat
argument (as an object in the
workspace) or to the sp.file
argument (as the name of a saved file containing this
matrix).
A matrix dat.ppm
with columns representing the latitude and longitude of presence
locations and quadrature points along with the associated environmental data, as well as
a column Pres
indicating whether either point corresponds to a presence location or
a quadrature point, and a column wt
of observation weights.
Ian W. Renner
sampleQuad
for generating a regular grid of quadrature points.
getEnvVar
for interpolating environmental data to species presence locations.
## Do not run because of NOTE Examples with CPU time > 2.5 times elapsed time
#data(BlueMountains)
#species.ppm = ppmdat(sp.xy = BlueMountains$eucalypt, back.xy = BlueMountains$env,
#sp.scale = 1, datfilename = NA, writefile = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.