center: Center variables on their mean

Description Usage Arguments Value Examples

View source: R/center.R

Description

Center variables on their mean

Usage

1
center(data, ..., na.rm = TRUE)

Arguments

data

a data.frame

...

variables to center. Can use tidyselect as in dplyr::select(). If none are included, default is to center all numeric variables.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

Value

a data.frame

Examples

1
2
3
4
5
6
7
library(dplyr)

center(mtcars)

center(mtcars, hp)

center(mtcars, starts_with("c"))

malcolmbarrett/mbmisc documentation built on May 17, 2019, 8:16 a.m.