Skip to contents

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

Usage

format_chars_and_dates(tbl)

Arguments

tbl

a data frame, the SDTM table

Value

a modified copy of the tbl data frame

Details

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

Examples

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)
#>        dates strings nums
#> 1 2017-02-05            1
#> 2               this   NA