diff --git a/R/observe.R b/R/observe.R index 59c751c92..96088313c 100644 --- a/R/observe.R +++ b/R/observe.R @@ -44,9 +44,8 @@ observe_process <- function(linelist) { filter_obs_by_obs_time <- function(linelist, obs_time) { linelist |> mutate( - obs_time = obs_time - .data$ptime, - censored_obs_time = .data$obs_time - .data$ptime_lwr, - censored = "interval" + obs_time = obs_time, + relative_obs_time = .data$obs_time - .data$ptime, ) |> filter(.data$stime_upr <= .data$obs_time) } diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index c3d6abed2..9ccab8c56 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -52,14 +52,16 @@ sim_obs_sex_m <- dplyr::filter(sim_obs_sex, sex == 0) |> dist = rlnorm, meanlog = meanlog_m, sdlog = sdlog_m - ) + ) |> + dplyr::select(case, ptime, delay, stime, sex) sim_obs_sex_f <- dplyr::filter(sim_obs_sex, sex == 1) |> simulate_secondary( dist = rlnorm, meanlog = meanlog_f, sdlog = sdlog_f - ) + ) |> + dplyr::select(case, ptime, delay, stime, sex) sim_obs_sex <- dplyr::bind_rows(sim_obs_sex_m, sim_obs_sex_f) |> observe_process() |>