Generate actual times from dates and times
sdtm_time_actual.Rd
Generate actual times from dates and times
Usage
sdtm_time_actual(x, ...)
# S3 method for list
sdtm_time_actual(x, ...)
# S3 method for data.frame
sdtm_time_actual(
x,
ref_col = "DTC_first_dose",
dtc_col_pattern = "DTC$",
units = "hours",
tz = NULL,
...
)
Arguments
- x
An SDTM data set
- ...
Passed to methods.
- ref_col
The character name of the column to use as a reference time point.
- dtc_col_pattern
The regex to use to select columns to use for actual time generation. The regex will also be used to modify the name.
- units
The units to report the actual time in (passed to
as.numeric
).- tz
The time zone for difftime (default is used if
is.null(tz)
).
Value
x
with new columns matching dtc_col_pattern
named
gsub(pattern=dtc_col_pattern, replacement=paste0("actual_", units),
names(x))
The new columns will have the actual time in numerical values
matching the units
.
See also
Other Date management and conversion:
dateany_to_date()
,
generate_dtc()
,
is_ISO8601_calendar_datetime()
,
is_ISO8601_calendar_date()
,
is_ISO8601_ordinal_datetime()
,
is_ISO8601_timezone()
,
is_ISO8601_time()
,
is_ISO8601_week_datetime()
,
make_dy()
,
pattern_ISO8601_any_datetime()
,
pattern_ISO8601_any_date()
,
pattern_ISO8601_calendar_datetime()
,
pattern_ISO8601_calendar_date()
,
pattern_ISO8601_calendar_year()
,
pattern_ISO8601_ordinal_datetime()
,
pattern_ISO8601_ordinal_date()
,
pattern_ISO8601_timezone()
,
pattern_ISO8601_time()
,
pattern_ISO8601_week_datetime()
,
pattern_ISO8601_week_date()
,
sdtm_dtc_to_datetime()
,
sdtm_first_dose()