s2bak.scale: Scale continuous values within data.frame.

View source: R/s2bak_etc.R

s2bak.scaleR Documentation

Scale continuous values within data.frame.

Description

Scales columns to a mean of 0 and standard deviation of 1. Does not scale binary and categorical predictors. If providing projected data as well, then it will scale them using the mean and standard deviation of the inputted environment and output both as a list.

Usage

s2bak.scale(data, project = NA, getScaleValues = FALSE)

Arguments

data

Values to scale, with column names indicating the variable

project

Projected values to scale, using the mean and standard deviations of 'env'. If NA, then the function will only scale the environmental values provided

getScaleValues

Return mean and standard deviations of each factor

Value

Returns a data.frame of scaled columns for non-categorical and non-binary variables. If getScaleValues or project data is provided, returns as a list.


leung-lab/s2bak documentation built on March 1, 2023, 9:10 a.m.