Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/compute.R
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ compute_exposure_predictions <- function(

if (!rlang::is_empty(cmaxes)) {
new_conc <- c(prediction_df$conc, cmaxes)
prediction_df <- tibble::tibble(conc = sort(unique(new_conc)))
prediction_df <- tibble::tibble(conc = sort(new_conc))
}

########## SHOULD THIS BE ITS OWN FUNCTION? ############
Expand Down
39 changes: 0 additions & 39 deletions tests/testthat/test-compute_exposure_predictions.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,3 @@ test_that('compute_exposure_predictions runs fine for good model and full data',
)
)
})


test_that('compute_exposure_predictions does not add non-unique conc values with cmaxes', {
data_proc <- preprocess(cqtkit_data_dofetilide)
mod <- fit_prespecified_model(
data_proc,
deltaQTCF,
ID,
CONC,
deltaQTCFBL,
TRTG,
TAFD,
method = "ML",
remove_conc_iiv = TRUE
)

expo_pred <- compute_exposure_predictions(
data_proc,
mod,
CONC,
treatment_predictors = list(
CONC = 10,
deltaQTCFBL = 0,
TRTG = "Dofetilide",
TAFD = "1 HR"
),
control_predictors = list(
CONC = 0,
deltaQTCFBL = 0,
TRTG = "Placebo",
TAFD = "1 HR"
),
cmaxes = c(100, 200, 300)
)

expect_true(
expo_pred$conc |> length() == expo_pred$conc |> unique() |> length()
)
})
Loading