powered by
Re-arranges partial dates from a format of "UN-UNK-UNKN" ("DD-MMM-YYYY") to "UN/UN/UNKN" ("MM/DD/YYYY").
"UN-UNK-UNKN"
"DD-MMM-YYYY"
"UN/UN/UNKN"
"MM/DD/YYYY"
reshape_pdates(dates, output_sep = "/")
a character vector of partial dates in the format "UN/UN/UNKN"
("MM/DD/YYYY")
a character vector of partial dates
the date component separator for the output, default is "/"
"/"
The separator character between dates components for the input vector dates can be any commonly used date separator ("/", "-", ".", " ").
dates
"-"
"."
" "
In the starting format, the month ("UNK") is a three letter abbreviation but, in the output format, the month is converted to a number
"UNK"
The output format is a character vector, not a Date vector, to make some common SDTM date workflow operations easier
The case of the input month abbreviation does not matter; "Feb", "feb", and "FEB" will yield the same results
"Feb"
"feb"
"FEB"
reshape_adates(), impute_pdates(), trim_dates(), vignette("Dates")
reshape_adates()
impute_pdates()
trim_dates()
vignette("Dates")
dates <- c( "UN-UNK-UNKN", "UN/UNK/UNKN", "UN-UNK-2017", "UN-Feb-2017", "05-Feb-2017", "05-UNK-2017", "05-Feb-UNKN", NA ) reshape_pdates(dates)
Run the code above in your browser using DataLab