Learn R Programming

socviz (version 2.0.0)

center_df: center_df

Description

Scale and/or center the numeric columns of a data frame or tibble

Usage

center_df(data, sc = FALSE, cen = TRUE)

Value

An object of the same class as `data`, with the numeric columns scaled or centered as requested

Arguments

data

A data frame or tibble

sc

Scale the variables (default FALSE)

cen

Center the variables on their means (default TRUE)

Author

Kieran Healy

Details

Takes a data frame or tibble as input and scales and/or centers the numeric columns. By default, centers but doesn't scale

Examples

Run this code
head(center_df(organdata))

Run the code above in your browser using DataLab