compute_pctaccess: Compute nth percentile accessibility

Description Usage Arguments Details Value

View source: R/accessdiff.R

Description

Computes the number of opportunities accessible to an arbitrary percentile of the population.

Usage

1
compute_pctaccess(tiff, weight_tiff = NULL, ...)

Arguments

tiff

A Conveyal tiff with accessibility scores.

weight_tiff

A Conveyal raster layer containing origin-side opportunities to use for weighting.

...

Arguments passed on to Hmisc::wtd.quantile

x

a numeric vector (may be a character or category or factor vector for wtd.table)

weights

a numeric vector of weights

normwt

specify normwt=TRUE to make weights sum to length(x) after deletion of NAs. If weights are frequency weights, then normwt should be FALSE, and if weights are normalization (aka reliability) weights, then normwt should be TRUE. In the case of the former, no check is made that weights are valid frequencies.

na.rm

set to FALSE to suppress checking for NAs

probs

a vector of quantiles to compute. Default is 0 (min), .25, .5, .75, 1 (max).

type

For wtd.quantile, type defaults to quantile to use the same interpolated order statistic method as quantile. Set type to "(i-1)/(n-1)","i/(n+1)", or "i/n" to use the inverse of the empirical distribution function, using, respectively, (wt - 1)/T, wt/(T+1), or wt/T, where wt is the cumulative weight and T is the total weight (usually total sample size). These three values of type are the possibilities for wtd.Ecdf. For wtd.table the default type is "list", meaning that the function is to return a list containing two vectors: x is the sorted unique values of x and sum.of.weights is the sum of weights for that x. This is the default so that you don't have to convert the names attribute of the result that can be obtained with type="table" to a numeric variable when x was originally numeric. type="table" for wtd.table results in an object that is the same structure as those returned from table. For wtd.loess.noiter the default type is "all", indicating that the function is to return a list containing all the original values of x (including duplicates and without sorting) and the smoothed y values corresponding to them. Set type="ordered all" to sort by x, and type="evaluate" to evaluate the smooth only at evaluation equally spaced points between the observed limits of x.

Details

Serves as a wrapper to wtd.quantile

Value

A named vector of quantile values


transportfoundry/tvmeasures documentation built on May 22, 2019, 10:57 p.m.