parLamapCaller: parLamapCaller

Description Usage Arguments Value

Description

Wrapper designed to call the 'lamap' function for use in 'sapply'-like calls.

Usage

1
2
parLamapCaller(x, rasterdata, knownsite_pcdfs, knownsite_coords, steps,
  maxsites, weightfun, weightparams, combinations, nosupport, partial)

Arguments

x

Int. Corresponds to the index of a single raster cell in a 'raster' object. See the R package 'raster'.

rasterdata

Raster object. Likely a raster stack from the package 'raster'

knownsite_pcdfs

List of of lists containing cdfs for each known site. See 'pcdf()'.

knownsite_coords

Dataframe containing xy coordinates for each known site. The columns need to be named "id","x","y". The ids should be ordered to correspond to the order of sites in the knownsite_pcdfs list. For now, only UTM coordinates should be used.

steps

A vector of window sizes for each variable of interest. The steps will be used to estimate integrals from the knownsite_pcdfs. They will be added/subtracted from the observed values to create integration intervals. The order of steps in this vector must correspond to the order of column variables in the 'observed' dataframe—which must also match the order of columns in training dataframe—i.e., 'traindf'—passed to the 'pcdf' function.

maxsites

The maximum number of sites from the known-site training data to include in the calculations. This is primarily a convenience parameter that can be used to speed up calculations when the training set contains a large number of sites.

weightfun

The function used to weight the lamap values by distance. It can be one of 'uniform' or 'exponential'—see 'weight' function.

weightparams

A vector of parameters passed to the 'weight' function.

combinations

A conveience paramter used to speed up calculations. The lamap calculation involves the use of hte inclusion-exclusion principle for estimating the total probability of a union of independent events. Consequently, the R 'combn' function is used and can slow the calculations considerably. However, the user can instead use a utility function provided with this package—'prepCombinations'. It computes the combinations which can then be saved and passed to the lamap function with this parameter, saving the algorithm from having to regenerate the combinations for every cell in in the desired output map.

Value

LAMAP value for one raster cell—see 'lamap'.


wccarleton/lamap documentation built on May 23, 2019, 1:25 p.m.