Convert the character representation of the date in an original SDTM dataset to a POSIXct object.
sdtm_dtc_to_datetime.Rd
Convert the character representation of the date in an original SDTM dataset to a POSIXct object.
Usage
sdtm_dtc_to_datetime(x, ...)
# S3 method for class 'list'
sdtm_dtc_to_datetime(x, ...)
# S3 method for class 'Date'
sdtm_dtc_to_datetime(x, ...)
# S3 method for class 'POSIXt'
sdtm_dtc_to_datetime(x, ...)
# S3 method for class 'character'
sdtm_dtc_to_datetime(x, truncated = 5, ...)
# S3 method for class 'data.frame'
sdtm_dtc_to_datetime(x, date_col_pattern = "DTC$", ...)
Arguments
- x
The data to convert
- ...
Additional arguments passed to `lubridate::ymd_hms()` or `lubridate::ymd()`
- truncated
Passed to `lubridate::ymd_hms()` or `lubridate::ymd()`; the `truncated` argument is always considered relative to `ymd_hms` formatting, so it is used as `truncated - 3` for dates.
- date_col_pattern
A regex to search column names for dates to convert.
Value
The data with the date converted. Note that all dates will be returned as POSIXct objects, so partial dates will appear as the
See also
Other Date management and conversion:
dateany_to_date()
,
generate_dtc()
,
is_ISO8601_calendar_date()
,
is_ISO8601_calendar_datetime()
,
is_ISO8601_ordinal_datetime()
,
is_ISO8601_time()
,
is_ISO8601_timezone()
,
is_ISO8601_week_datetime()
,
make_dy()
,
pattern_ISO8601_any_date()
,
pattern_ISO8601_any_datetime()
,
pattern_ISO8601_calendar_date()
,
pattern_ISO8601_calendar_datetime()
,
pattern_ISO8601_calendar_year()
,
pattern_ISO8601_ordinal_date()
,
pattern_ISO8601_ordinal_datetime()
,
pattern_ISO8601_time()
,
pattern_ISO8601_timezone()
,
pattern_ISO8601_week_date()
,
pattern_ISO8601_week_datetime()
,
sdtm_first_dose()
,
sdtm_time_actual()