epict_filter_ids | R Documentation |
Filter infection IDs based on characteristics
epict_filter_ids(
obs,
min_uncensored_tests = 2,
min_days_with_uncensored = 2,
invert = FALSE
)
obs |
A data.frame with the following variables:
|
min_uncensored_tests |
Numeric defaults to 2. The minimum number of uncensored tests an ID must have in order to be included in the processed dataset. |
min_days_with_uncensored |
Numeric defaults to 2. The minimum number of days tests per ID must span in order to be included in the processed dataset. |
invert |
Logical, defaults to |
A data.table
with IDs failing/meeting the specified criteria
removed.
Sam Abbott
Preprocessing functions
epict_check_obs()
,
epict_check_raw_obs()
,
epict_clean_factors()
,
epict_drop_na_ct()
,
epict_flag_spurious_obs()
,
epict_make_time_rel_to_first_uncensored()
,
epict_make_time_rel()
obs <- data.frame(
censored = c(TRUE, rep(FALSE, 3), TRUE, rep(FALSE, 4)),
id = c(1, 1, 1, 2, 3, 3, 4, 4, 4), t = c(0, 0, 1, 1, 1, 2, 1, 1, 1)
)
# Use defaults
epict_filter_ids(obs)
# Invert with defaults
epict_filter_ids(obs, invert = TRUE)
# Remove IDs with less than 3 tests
epict_filter_ids(obs, min_uncensored_tests = 3, min_days_with_uncensored = 1)
# Remove IDs with less than 3 tests - this will be all available data
epict_filter_ids(obs, min_days_with_uncensored = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.