trim_and_make_blanks_NA: Trim white space and make blanks NA

View source: R/format.R

trim_and_make_blanks_NAR Documentation

Trim white space and make blanks NA

Description

Trims the white space on both sides of strings in a character vector and replaces blank values ("" and " ") with NA for all columns in a data frame that have a character class.

Usage

trim_and_make_blanks_NA(tbl)

Arguments

tbl

a data frame, the SDTM table

Details

This function should be applied as one of the first steps in the data process to ensure consistent handling of all strings.

Value

a modified copy of the tbl data frame

See Also

format_chars_and_dates()

Examples

df <- data.frame(one = c("   a", "", " "))
trim_and_make_blanks_NA(df)


sdtmval documentation built on Oct. 23, 2023, 5:10 p.m.