epict_make_time_rel_to_first_uncensored: Make time relative to first uncensored test per ID

View source: R/preprocess.R

epict_make_time_rel_to_first_uncensoredR Documentation

Make time relative to first uncensored test per ID

Description

Make time relative to first uncensored test per ID

Usage

epict_make_time_rel_to_first_uncensored(obs)

Arguments

obs

A data.frame with the following variables:

  • id: An integer vector uniquely identifying each infection.

  • t: Time of test relative to a baseline date.

  • onset_t: Time on onset relative to a baseline date (optional).

  • censored: Logical, indicating if the Ct has been censored.

Value

A data.table with times relative to the first uncensored test per ID.

Author(s)

Sam Abbott

See Also

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()

Examples

obs <- data.frame(
 id = c(rep(1, 3), rep(2, 4)), t = c(2, 3, 4, 1, 1, 2, 8), 
 onset_t = c(rep(2, 3), rep(4, 4)),
 censored = c(TRUE, FALSE, FALSE, TRUE, rep(FALSE, 3))
)

epict_make_time_rel_to_first_uncensored(obs)

seabbs/epict documentation built on July 3, 2023, 6:42 a.m.