sdtm_time_actual: Generate actual times from dates and times

Description Usage Arguments Value

View source: R/time_actual.R

Description

Generate actual times from dates and times

Usage

1
2
3
4
5
6
7
8
sdtm_time_actual(x, ...)

## S3 method for class 'list'
sdtm_time_actual(x, ...)

## S3 method for class '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.


billdenney/Rsdtm documentation built on Aug. 14, 2018, 4:31 a.m.