convert_dtc_to_dt {admiral} | R Documentation |
Convert a Date Character Vector into a Date Object
Description
Convert a date character vector (usually '–DTC') into a Date vector (usually '–DT').
Usage
convert_dtc_to_dt(
dtc,
highest_imputation = "n",
date_imputation = "first",
min_dates = NULL,
max_dates = NULL,
preserve = FALSE
)
Arguments
dtc |
The –DTC date to convert. |
highest_imputation |
Highest imputation level The If a component at a higher level than the highest imputation level is
missing, If If Permitted Values: |
date_imputation |
The value to impute the day/month when a datepart is missing. A character value is expected, either as a
The argument is ignored if |
min_dates |
Minimum dates A list of dates is expected. It is ensured that the imputed date is not
before any of the specified dates, e.g., that the imputed adverse event start
date is not before the first treatment date. Only dates which are in the
range of possible dates of the impute_dtc_dtm( "2020-11", min_dates = list( ymd_hms("2020-12-06T12:12:12"), ymd_hms("2020-11-11T11:11:11") ), highest_imputation = "M" ) returns |
max_dates |
Maximum dates A list of dates is expected. It is ensured that the imputed date is not after any of the specified dates, e.g., that the imputed date is not after the data cut off date. Only dates which are in the range of possible dates are considered. A date or date-time object is expected. |
preserve |
Preserve day if month is missing and day is present For example Permitted Values: |
Details
Usually this computation function can not be used with %>%
.
Value
a date object
See Also
Date/Time Computation Functions that returns a vector:
compute_age_years()
,
compute_dtf()
,
compute_duration()
,
compute_tmf()
,
convert_date_to_dtm()
,
convert_dtc_to_dtm()
,
impute_dtc_dt()
,
impute_dtc_dtm()
Examples
convert_dtc_to_dt("2019-07-18")
convert_dtc_to_dt("2019-07")