lcmem_prep: Prep Data Frame for trajpkg functions

Description Usage Arguments Value

View source: R/lcmem_prep.R

Description

This function centers and scales the variables provided by vars by subtracting by the mean and dividing by the starndard deviation. It will also create new columns appending with "_ns" to save the original nonscaled values.

Usage

1
lcmem_prep(df, vars, center = TRUE, scale = TRUE)

Arguments

df

Dataframe object

vars

character vector providing the names of the columns we would like to center and scale

center

a boolean that specifies if vars should be centered by subtracting by the mean

scale

a boolean that spcifies if vars should be devided by their standard deviation

Value

a dataframe with vars centered and scaled and their nonscaled values stores as var_ns


wfmueller29/trajpkg documentation built on Feb. 6, 2022, 3:45 a.m.