effect_coding {psycCleaning}R Documentation

Effect Coding

Description

Create effect-coded columns, supporting tidyselect syntax to process multiple columns simultaneously.

Usage

effect_coding(data, cols, factor = FALSE)

Arguments

data

A data.frame or a data.frame extension (e.g. a tibble).

cols

Columns that need to be effect-coded. See 'dplyr::dplyr_tidy_select' for available options.

factor

The default is 'FALSE'. If factor is set to 'TRUE', this function returns a tibble with effect-coded factors. If factor is set to 'FALSE', this function returns a tibble with effect-coded columns.

Value

An object of the same type as .data. The output has the following properties: 1. Columns from .data will be preserved. 2. Columns that are effect-coded.

Examples

effect_coding(iris,Species)


[Package psycCleaning version 0.1.1 Index]