diff --git a/DESCRIPTION b/DESCRIPTION index 07ade04d..c63f4fa6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,8 +29,8 @@ URL: https://github.com/InsightRX/PKPDsim, Language: en-US LazyData: TRUE Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.3 Config/testthat/edition: 3 Config/Needs/website: tidyverse, nlmixr2 Encoding: UTF-8 VignetteBuilder: knitr +Config/roxygen2/version: 8.1.0 diff --git a/NAMESPACE b/NAMESPACE index 92cbb2de..a6011dfd 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -37,6 +37,7 @@ export(get_parameters_from_code) export(get_var_y) export(ifelse0) export(install_default_literature_model) +export(is_bolus_or_oral) export(is_positive_definite) export(join_cov_and_par) export(join_regimen) @@ -71,11 +72,15 @@ export(translate_ode) export(triangle_to_full) importFrom(Rcpp,sourceCpp) importFrom(magrittr,`%>%`) -importFrom(stats,aggregate) -importFrom(stats,qnorm) -importFrom(stats,quantile) -importFrom(stats,reshape) -importFrom(stats,rnorm) -importFrom(utils,packageVersion) -importFrom(utils,tail) +importFrom(stats, + aggregate, + qnorm, + quantile, + reshape, + rnorm +) +importFrom(utils, + packageVersion, + tail +) useDynLib(PKPDsim) diff --git a/R/new_regimen.R b/R/new_regimen.R index d0790a3f..38e709b6 100644 --- a/R/new_regimen.R +++ b/R/new_regimen.R @@ -140,7 +140,7 @@ new_regimen <- function( reg$t_inf[is_bolus_or_oral(reg)] <- 0 reg$rate[is_bolus_or_oral(reg)] <- 0 } - + if(!is.null(cmt)) { if(length(cmt) != length(reg$dose_times)) { cmt <- rep(cmt[1], length(reg$dose_times)) @@ -162,15 +162,15 @@ new_regimen <- function( } #' Is regimen type oral or bolus? (i.e., treat t_inf as zero) -#' -#' Any regimen matching exactly the string 'bolus' or containing the string -#' 'oral' will return `TRUE`, otherwise `FALSE`. Bolus/oral regimens are +#' +#' Any regimen matching exactly the string 'bolus' or containing the string +#' 'oral' will return `TRUE`, otherwise `FALSE`. Bolus/oral regimens are #' generally treated as having an infusion duration of zero. -#' +#' #' @param regimen object of class "regimen"` -#' @returns Returns a logical vector of length equal to the number of doses in +#' @returns Returns a logical vector of length equal to the number of doses in #' the regimen - +#' @export is_bolus_or_oral <- function(regimen) { regimen$type == "bolus" | grepl("oral", regimen$type) -} \ No newline at end of file +} diff --git a/man/regimen_to_nm.Rd b/man/regimen_to_nm.Rd index 1cc17c28..76f15916 100644 --- a/man/regimen_to_nm.Rd +++ b/man/regimen_to_nm.Rd @@ -30,7 +30,7 @@ regimen_to_nm( Data frame containing doses } \description{ -Note: when bioavailability is used for insusions: NONMEM behaves differently from PKPDsim and Monolix, +Note: when bioavailability is used for infusions: NONMEM behaves differently from PKPDsim and Monolix, in that rates are not automatically recomputed for infusions where bioavailabiliy also applies. In PKPDsim/Monolix, for a bioavailability of 50\%, an AMT of 100 mg and rate of 100mg/hr would be recalculated to 50 mg and 50 mg/hour, respectively, to keep the infusion length the same. This is not the case