QuantileRescale: R6 Quantile Rescale

Description Arguments Examples

Description

The R6 class QuantileRescale transforms data into 0-1 or 0-100 scale with values above (1-p)% and below p% percentiles taken as the nearest endpoints.

Arguments

x

An R object. Currently there are methods for numeric vectors, matrices, and data frames.

select

expression, indicating columns to select from a data frame or matrix

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds. This class is missing tolerable (i.e., compatible), in which the transformation will not remove NAs if na.rm is FALSE, it abides the dimension of vectors and retrun NAs beside the truly transformed values.

digits

integer indicating the number of decimal places to be used.

probs

numeric vector of probabilities with values in [0,1].

max

a scalar indicating the maximum endpoint of rescaled variable. The might be 1, 100, etc.

type

an integer between 1 and 9 selecting one of the nine quantile algorithms explained in quantile to be used.

Examples

1
2
3
4
5
6
x <- c(
   0.2, 0.5, 1.1, 1.4, 1.8, 2.3, 2.5, 2.7, 3.5, 4.4,
   4.6, 5.4, 5.4, 5.7, 5.8, 5.9, 6.0, 6.6, 7.1, 7.9
)
x_trf <- QuantileRescale$new(x)$transform_x()
R6::is.R6(x_trf)

MaaniBeigy/DescObs documentation built on May 23, 2019, 9:37 a.m.