Learn R Programming

DAMisc (version 1.7.2)

scaleDataFrame: Standardize quantitative variables in a data frame

Description

This function standardizes quantitative variables in a data frame while leaving the others untouched. This leaves not only factors, but also binary variables (those with values 0, 1, or NA).

Usage

scaleDataFrame(data, numsd = 1, nvals_fac = 11, exclude = NULL)

Arguments

data

A data frame.

numsd

Number of standard deviations to divide by - defaults to 1.

nvals_fac

Number of unique values required to standardize - variables with fewer than `nvals_fac` unique values will not be standardized.

exclude

A character vector of names of variables to exclude from the standardization.

Value

A data frame with standardized quantitative variables