sanitize_terms: Sanitize Term Names

View source: R/utils_text.R

sanitize_termsR Documentation

Sanitize Term Names

Description

Remove characters from term names that will be difficult to address using the $-operator. This function is not exported.

Usage

sanitize_terms(x, standardized = FALSE)

## S3 method for class 'character'
sanitize_terms(x, standardized = FALSE)

## S3 method for class 'factor'
sanitize_terms(x, standardized = FALSE)

## S3 method for class 'data.frame'
sanitize_terms(x, standardized = FALSE)

## S3 method for class 'list'
sanitize_terms(x, standardized = FALSE)

Arguments

x

Character. Vector of term names to be sanitized.

standardized

Logical. If TRUE, the name of the function [scale()] will be removed from term names.

Value

An object of the same class as x containing sanitized term names as characters.

Examples

  sanitize_terms(c("(Intercept)", "Factor A", "Factor B", "Factor A:Factor B", "scale(FactorA)"))

papaja documentation built on Sept. 29, 2023, 9:07 a.m.