sampleQuad: Generate regular grid of quadrature points with environmental...

View source: R/ppmlasso/R/ppmlasso_functions.R View source: R/ppmlasso_functions.R

sampleQuadR Documentation

Generate regular grid of quadrature points with environmental data

Description

This function generates a regular grid of quadrature points and associated environmental data at a nominated spatial resolution.

Usage

sampleQuad(env.grid, sp.scale, coord = c("X", "Y"), quadfilename = "Quad", tol = 0.01, 
writefile = TRUE)

Arguments

env.grid

The geo-referenced matrix of environmental grids. It must have a vector of longitude and a vector of latitude.

sp.scale

The spatial resolution at which to sample quadrature points.

coord

A vector containing the names of the longitude and latitude coordinates.

quadfilename

An optional argument containing the prefix of the name of the saved file. The default is "Quad" so that a matrix generated at a spatial resolution of 1 would be saved in the file "Quad1.RData". A file is saved for every resolution given in sp.scale.

tol

An optional argument to specify the tolerance level of coordinate error passed to an internal call to the griddify function, set to 0.01 by default.

writefile

A logical argument to determine whether the output should be written to a file or not. If TRUE (the default), the output will be saved with the file name as described in the quadfilename argument.

Value

The output is a matrix of quadrature points at the spatial resolution supplied to sp.scale. If a vector of resolutions is supplied, the output is a list of matrices for each spatial resolution.

Author(s)

Ian W. Renner

Examples

data(BlueMountains)
quad.1 = sampleQuad(env.grid = BlueMountains$env, sp.scale = 1, quadfilename = NA, 
writefile = FALSE)

ppmlasso documentation built on May 29, 2024, 7:12 a.m.