Skip to contents

Generic for centering. See center.tidymatrix for the tidymatrix method.

Usage

center(x, ...)

Arguments

x

An object to center

...

Arguments passed to methods

Value

An object of the same class as x, centered

Examples

tm <- tidymatrix(big5_responses, big5_respondents, big5_items)

# Center each item (column) on its mean
tm |>
  activate(columns) |>
  center()
#> # A tidymatrix: 400 x 30 matrix
#> # Active: columns
#> #
#> # Row data: 400 rows x 8 columns
#> # Column data: 30 rows x 5 columns
#> #
#> # Active data (columns):
#>   item_id        trait reversed                             item_text position
#> 1      E1 Extraversion    FALSE     I feel comfortable around people.        1
#> 2      E2 Extraversion    FALSE                I start conversations.        6
#> 3      E3 Extraversion    FALSE I enjoy being part of a lively crowd.       11
#> 4      E4 Extraversion    FALSE                I make friends easily.       16
#> 5      E5 Extraversion     TRUE             I keep in the background.       21
#> 6      E6 Extraversion     TRUE    I have little to say to strangers.       26