scale_this {tidyrstats}R Documentation

Scale a numeric vector without converting to a matrix

Description

This function scales and centres a numeric vector by subtracting the mean and dividing by the standard deviation. Unlike 'scale()', it returns a numeric vector, not a matrix. Note this function does not allow control over centering or scaling.

Usage

scale_this(x)

Arguments

x

A numeric vector.

Value

A numeric vector of scaled values.

Examples

iris_dat <- head(iris$Sepal.Length)
scale_this(iris_dat)
scale_this(c(iris_dat, NA))

[Package tidyrstats version 0.1.0 Index]