make.pctile.cols.alt2: Alternative way to make columns of (weighted) percentiles...

View source: R/make.pctile.cols.alt2.R

make.pctile.cols.alt2R Documentation

Alternative way to make columns of (weighted) percentiles from columns of values

Description

Takes a data.frame of values and returns a data.frame of percentiles, showing the percentile of a value within all values in its column.

Usage

make.pctile.cols.alt2(
  raw.data.frame,
  weights,
  as.df = TRUE,
  prefix = "pctile.",
  na.rm = TRUE,
  zone = NULL
)

Arguments

raw.data.frame

Data.frame of values

weights

Optional Numeric vector of weights to create weighted percentiles, such as population-weighted quantiles. Unweighted if not specified. Vector same length as number of rows in data.frame.

as.df

Optional logical TRUE by default, in which case matrix results are converted to data.frame

prefix

Optional character element, default is 'pctile.', provides text to paste to beginning of input data.frame column names to use as output column names.

na.rm

Default is TRUE. Passed to assign.pctiles.alt2()

zone

NULL by default, but if a vector is provided, it defines zones to group by, so percentiles are within a given zone only.

Value

Returns a matrix or data.frame

See Also

make.bin.pctile.cols() and assign.pctiles()


ejanalysis/ejanalysis documentation built on April 2, 2024, 10:12 a.m.