diff --git a/R/interpolate.conc.R b/R/interpolate.conc.R index b313cf3f..918ca942 100644 --- a/R/interpolate.conc.R +++ b/R/interpolate.conc.R @@ -276,8 +276,8 @@ extrapolate.conc <- function(conc, time, time.out, if (auc.type %in% "aucinf") { # If AUCinf is requested, extrapolate using the half-life ret <- extrapolate_conc_lambdaz(clast=clast, lambda.z=lambda.z, tlast=tlast, time_out=time.out) - } else if (auc.type %in% "auclast" | - (auc.type %in% "aucall" & + } else if (auc.type %in% "auclast" || + (auc.type %in% "aucall" && tlast == max(data$time))) { # If AUClast is requested or AUCall is requested and there are # no BLQ at the end, we are already certain that we are after diff --git a/R/sparse.R b/R/sparse.R index eaad17e5..7a59f2cc 100644 --- a/R/sparse.R +++ b/R/sparse.R @@ -9,7 +9,7 @@ #' @family Sparse Methods #' @export as_sparse_pk <- function(conc, time, subject) { - if (is.data.frame(conc) & missing(time) & missing(subject)) { + if (is.data.frame(conc) && missing(time) && missing(subject)) { time <- conc$time subject <- conc$subject conc <- conc$conc