Learn R Programming

SciencesPo (version 0.11.21)

rescale: Rescaling as Z-scores and Centering

Description

Provides a rapidly way to generate standard variables.

Usage

rescale(x, FUN = "center")

Arguments

x
A vector to be computed
FUN
A function to be applied: `z-score' or `z', the default is `center' or `c'.

Value

  • An object the same class as x.

encoding

UTF-8

Examples

Run this code
x <- sample(10)
rescale(x) # centering 
rescale(x, FUN=="full")
rescale(x, FUN=="-0.5,0.5") # for binary input
rescale(x, FUN=="0/1") # for binary input

Run the code above in your browser using DataLab