epict_make_time_rel | R Documentation |
Make time relative to first date of the test.
epict_make_time_rel(obs, baseline_date = min(obs$test_date, na.rm = TRUE))
obs |
A
|
baseline_date |
A date to use as the baseline date for all other times in the dataset. By default this is the minimum test date in the dataset. |
A data.table
with a t
variable containing the numeric time in
days since the baseline_date
.
Sam Abbott
Preprocessing functions
epict_check_obs()
,
epict_check_raw_obs()
,
epict_clean_factors()
,
epict_drop_na_ct()
,
epict_filter_ids()
,
epict_flag_spurious_obs()
,
epict_make_time_rel_to_first_uncensored()
obs <- data.frame(test_date = as.Date(c("2022-04-22", "2022-04-19")))
# Using default baseline date
epict_make_time_rel(obs)
# Using user specified baseline date
epict_make_time_rel(obs, baseline_date = as.Date("2022-04-01"))
# When onsets are present
obs$onset_date <- obs$test_date
epict_make_time_rel(obs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.