center_df function

center_df

center_df

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

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

Arguments

  • data: A data frame or tibble
  • sc: Scale the variables (default FALSE)
  • cen: Center the variables on their means (default TRUE)

Returns

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

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

head(center_df(organdata))

Author(s)

Kieran Healy

  • Maintainer: Kieran Healy
  • License: MIT + file LICENSE
  • Last published: 2020-06-10