weight: weight

Description Usage Arguments Details Value

Description

Weighting function for the 'lamap' algorithm. This function is essentially a switch that passes 'params' and 'distances' to the appropriate weighting function, which then returns a vector with the same length as 'distances' containing the weights.

Usage

1
weight(distances, weightfun, param = c())

Arguments

distances

Vector of distances—returned from 'orderSites'.

weightfun

The name of the weight function to use. Currently can be one of 'uniform' or 'exponential'

param

A vector of parameters to be used in the weighting function. See the apropriate function for details.

Details

Uniform: Uniform weighting based on distance. The 'param' vector should be a a single value specifying the maximum distance (in meters), beyond which weight is 0.

Exponential: Exponential weighting where the first element in 'param' affects the rate of decline in weight with increasing distance—higher values increase rate. The second element specifies the distance at which the weight is very nearly zero. The default for the second element is the maximum distance in the vector 'distances'. The exponential function is as follows: exp((-x/param[2])*param[1])

Value

Vector of weights in the same order as 'distances'.


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