uzscale: Universal z-scale function Standardize dataframe to z scores,...

View source: R/idsXform.R

uzscaleR Documentation

Universal z-scale function Standardize dataframe to z scores, safe for non-numeric variables. ELo 201904 GWU DATS

Description

Universal z-scale function Standardize dataframe to z scores, safe for non-numeric variables. ELo 201904 GWU DATS

Usage

uzscale(df, append = 0, excl = NULL)

Arguments

df

The dataframe.

append

T/F or 0/1. Option to append scaled columns or replace original columns in the dataframe.

excl

A list c(a,b,"d","ef") of excluded columns, either by their indexes and/or names.

Value

The transformed dataframe, appended or replaced with standardized scores. Non-numeric columns will not be appended, or if "replace option" is chosen, the columns will be untouched.

Examples

  tmp = uzscale( ISLR::Hitters )
  tmp = uzscale( ISLR::Hitters, 1 )
  tmp = uzscale( ISLR::Hitters, TRUE, c(19,"NewLeague") )

physicsland/ezids documentation built on Feb. 4, 2024, 2:13 a.m.