scaler: Feature scaling

View source: R/scaler.R

scalerR Documentation

Feature scaling

Description

Performs feature scaling such as Z-score and min-max scaling.

Usage

scaler(x, scale = c("minmax", "zscore"), col = "auto", 
       par1 = NULL, par2 = NULL, na.rm = FALSE)

Arguments

x

a numerical vector, a matrix or a data.frame.

scale

a transfer for x.

col

a character vector of column names or indices. If "auto", all numeric columns will be transformed. If "all", all columns will be transformed.

par1

a numerical value or vector that for the case scale = "minmax" indicating the maximum value(s) and for the case scale = "zscore" indicating the mean value(s).

par2

a numerical value or vector that for the case scale = "minmax" indicating the maximum value(s) and for the case scale = "zscore" indicating the sd value(s).

na.rm

a logical value indicating whether NA values in x should be stripped before the computation proceeds.

Value

transformed version of x.

Author(s)

Reza Mohammadi a.mohammadi@uva.nl and Kevin Burke kevin.burke@ul.ie

See Also

zscore, minmax

Examples

x = c(2.3, -1.4, 0, 3.45)

scaler(x, scale = "minmax")

scaler(x, scale = "zscore")

liver documentation built on April 3, 2025, 10:51 p.m.