fp_add_scale: Scale factors levels

fp_add_scaleR Documentation

Scale factors levels

Description

This function allows to add columns to a design matrix with scaled factor, i.e. factors reported in real units rather in coded units (e.g. -1, 1).

Usage

fp_add_scale(dm, ..., suffix = "_s")

Arguments

dm

the design matrix to scale.

...

a set of factors to scale, with their respective ranges, e.g. ⁠A=c(10, 30), B=c(0, 1)⁠.if the range is not a two-number vector or the factor is not numeric, a warning is printed and the factor is skipped.

suffix

the suffix to add to the scaled factor name in creating new columns. If the suffix is the empty string, factors are replaced.

Value

the design matrix with the scaled factors.

Examples

fp_design_matrix(3, rep=2) %>%
  fp_add_scale(A=c(10, 30), B=c(0, 1), suffix=".scaled")

adas.utils documentation built on April 12, 2025, 1:52 a.m.