code_control_named: Variant of code_control that generates more verbose column...

code_control_namedR Documentation

Variant of code_control that generates more verbose column names

Description

This function is a drop-in replacement for codingMatrices::code_control(), except that when generating a contrast matrix, it gives column names of the form "A.vs.B" instead of "B-A".

Usage

code_control_named(n, contrasts = TRUE, sparse = FALSE, sep = ".vs.")

Arguments

n, contrasts, sparse

These arguments are identical codingMatrices::code_control().

sep

The string to insert between two levels in order to generate the column names of the coding matrix.

Value

The same as codingMatrices::code_control(), but with more descriptive column names.

See Also

codingMatrices::code_control()

Examples

library(codingMatrices)

# Compare the resulting column names
code_control(4)
code_control_named(4)


DarwinAwardWinner/rctutils documentation built on July 22, 2022, 5:19 a.m.