fct_trim: Trim whitespace from factor levels

View source: R/fct_trim.R

fct_trimR Documentation

Trim whitespace from factor levels

Description

Trim whitespace from factor levels

Usage

fct_trim(f, ...)

Arguments

f

A factor variable with whitespace

...

Arguments passed on to 'stringr::str_trim()'

Value

A factor variable with whitespace removed

Examples

var <- factor(c("  Level with trailing and leading white space\t",
"\n\nLevel with trailing and leading white space\n\n"))
fct_trim(var)

philstraforelli/forcatsmisc documentation built on July 4, 2023, 9:52 a.m.