Learn R Programming

sdtmval (version 0.4.1)

format_chars_and_dates: Format date and character columns for SDTM tables

Description

Converts all date columns to character class and replaces all NA values in character/date columns with "".

Usage

format_chars_and_dates(tbl)

Value

a modified copy of the tbl data frame

Arguments

tbl

a data frame, the SDTM table

Details

This function should be applied as one of the last steps in the data process but before assign_meta_data().

See Also

trim_and_make_blanks_NA()

Examples

Run this code
df <- data.frame(
  dates = as.Date(c("2017-02-05", NA)),
  strings = c(NA_character_, "this"),
  nums = c(1, NA)
)
format_chars_and_dates(df)

Run the code above in your browser using DataLab