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
4 changes: 2 additions & 2 deletions R/aucint.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ pk.calc.aucint <- function(conc, time,
interval <- assert_intervaltime_single(interval = interval, start = start, end = end)
missing_times <-
if (is.infinite(interval[2])) {
setdiff(c(interval[1], time.dose), data$time)
setdiff(c(interval[1], time.dose), c(data$time, NA))
} else {
setdiff(c(interval, time.dose), data$time)
setdiff(c(interval, time.dose), c(data$time, NA))
}
# Handle the potential double-calculation (before/after tlast) with AUCinf
conc_clast <- NULL
Expand Down
17 changes: 17 additions & 0 deletions tests/testthat/test-pk.calc.all.R
Original file line number Diff line number Diff line change
Expand Up @@ -766,3 +766,20 @@ test_that("Cannot include and exclude half-life points at the same time (#406)",
regexp = "Cannot both include and exclude half-life points for the same interval"
)
})

test_that("all parameters can be calculated (#367)", {
d_conc <- data.frame(conc = 2^(0:-5), time = 0:5)

o_conc <- PKNCAconc(d_conc, conc~time)
all_param_names <- names(get.interval.cols())
all_params <-
as.data.frame(
setNames(as.list(rep(TRUE, length(all_param_names))), all_param_names)
)
all_params$start <- 0
all_params$end <- Inf
# Parameters that do not work right now
all_params$aucint.last <- FALSE
o_data <- PKNCAdata(o_conc, intervals = all_params)
expect_error(o_nca <- pk.nca(o_data), NA)
})
Loading