Learn R Programming

SCORPIUS (version 1.0)

scale_quantile: Calculate and apply a quantile scale

Description

Calculate and apply a quantile scale

Usage

scale_quantile(x, outlier_cutoff = 0.05)

Arguments

x

A numeric matrix or data frame.

outlier_cutoff

The quantile cutoff for outliers (default 0.05).

Value

The centered, scaled matrix. The numeric centering and scalings used are returned as attributes.

Examples

Run this code
# NOT RUN {
## Generate a matrix from a normal distribution
## with a large standard deviation, centered at c(5, 5)
x <- matrix(rnorm(200*2, sd = 10, mean = 5), ncol=2)

## Center the dataset at c(0, 0) with a minimum of c(-.5, -.5) and a maximum of c(.5, .5)
x_scaled <- scale_quantile(x)

## Plot rescaled data
plot(x_scaled)

## Show ranges of each column
apply(x_scaled, 2, range)
# }

Run the code above in your browser using DataLab