diff --git a/NAMESPACE b/NAMESPACE index 4ea9a31e7..2e5b9bf60 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -27,6 +27,7 @@ S3method("ini<-",default) S3method("model<-",default) S3method("rxode2<-","function") S3method("rxode2<-",default) +S3method("units<-",rxEvid) S3method(.DollarNames,rxEt) S3method(.DollarNames,rxSolve) S3method(.DollarNames,rxUi) diff --git a/R/assert.R b/R/assert.R index 8a51820d0..fef90bb5b 100644 --- a/R/assert.R +++ b/R/assert.R @@ -625,6 +625,7 @@ warnRxBounded <- function(ui, extra="", .var.name=.vname(ui)) { #' @return boolean, indicating if the object is a valid initialization data frame #' @export #' @author Matthew L. Fidler +#' @family Assertions #' @examples #' testIniDf(TRUE) testIniDf <- function(iniDf) { diff --git a/R/et.R b/R/et.R index f8ee9af85..f552a4a22 100644 --- a/R/et.R +++ b/R/et.R @@ -1376,11 +1376,13 @@ as.character.rxEvid <- function(x, ...) { as.rxEvid(NextMethod()) } +#' @rdname rxEvid +#' @param value It will be an error to set units for evid +#' @export `units<-.rxEvid` <- function(x, value) { stop("'evid' is unitless", call. = FALSE) } - #' @export `[<-.rxEvid` <- function(x, i, value) { as.rxEvid(NextMethod()) diff --git a/R/linMod.R b/R/linMod.R index d1266dc3d..ad0e1633b 100644 --- a/R/linMod.R +++ b/R/linMod.R @@ -95,9 +95,8 @@ rxUdfUi.default <- function(fun) { #' `rxUdfUi()` for details. #' #' @export -#' +#' @family User functions #' @author Matthew L. Fidler -#' #' @examples #' #' linMod(x, 3) @@ -239,10 +238,13 @@ linMod <- function(variable, power, dv="dv", warning(.dv, "not found in data, so no initial estimates will be set to zero") } else { names(.dat)[.wdv] <- .dv - .model <- stats::lm(as.formula(paste0(.dv, " ~ stats::poly(", .var, ",", - power, ")", - ifelse(intercept, "", "+0"))), - data=rxUdfUiData()) + .model <- + stats::lm( + stats::as.formula( + paste0(.dv, " ~ stats::poly(", .var, ",", power, ")", + ifelse(intercept, "", "+0"))), + data=rxUdfUiData() + ) .est <- coef(.model) } } diff --git a/R/rudfui.R b/R/rudfui.R index 83df37f21..52b576a56 100644 --- a/R/rudfui.R +++ b/R/rudfui.R @@ -30,12 +30,12 @@ rxUdfUiReset() #' UI functions #' #' @return integer greater than 1L +#' @family User functions #' @export #' @author Matthew L. Fidler #' @examples #' #' rxUdfUiNum() -#' rxUdfUiNum <- function() { if (checkmate::testIntegerish(.udfUiEnv$num, lower=1L, len=1L, any.missing=FALSE)) { as.integer(.udfUiEnv$num) @@ -64,6 +64,7 @@ rxUdfUiIniDf <- function() { #' Return the lhs parsed language expression #' #' @return lhs language expression or NULL +#' @family User functions #' @export #' @author Matthew L. Fidler #' @examples @@ -87,6 +88,7 @@ rxUdfUiIniLhs <- function() { #' #' @return value of the `modelVariables` being processed or `NULL`. #' +#' @family User functions #' @export #' @author Matthew L. Fidler #' @examples @@ -113,6 +115,7 @@ rxUdfUiMv <- function(value) { #' @return value of the `data.frame` being processed or `NULL`. #' #' @export +#' @family User functions #' @author Matthew L. Fidler #' @examples #' @@ -135,6 +138,7 @@ rxUdfUiData <- function(value) { #' @param value when specified, this assigns the character value of #' the estimation method or NULL if there is nothing being estimated #' @return value of the estimation method being processed or NULL +#' @family User functions #' @export #' @author Matthew L. Fidler #' @examples @@ -156,6 +160,7 @@ rxUdfUiEst <- function(value) { #' Returns if the current ui function is being parsed #' #' @return logical if the current ui function is being parsed +#' @family User functions #' @export #' @author Matthew L. Fidler #' @examples diff --git a/_pkgdown.yml b/_pkgdown.yml index 838f424c9..a4b51a1d3 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -55,6 +55,7 @@ reference: - rxUiCompress - rxUiDecompress - rxode2<- + - testIniDf - testRxLinCmt - testRxUnbounded - update.rxUi @@ -160,6 +161,18 @@ reference: - rxSymInvChol - swapMatListWithCube - uppergamma +- title: User functions + contents: + - linMod + - rxIntToBase + - rxIntToLetter + - rxUdfUiData + - rxUdfUiEst + - rxUdfUiIniDf + - rxUdfUiIniLhs + - rxUdfUiMv + - rxUdfUiNum + - rxUdfUiParsing - title: Internal Functions contents: - .cbindOme diff --git a/man-roxygen/etExamples.R b/man-roxygen/etExamples.R index 664fa74d0..0fbca20b5 100644 --- a/man-roxygen/etExamples.R +++ b/man-roxygen/etExamples.R @@ -1,6 +1,6 @@ #' @examples #' -#' \donttest{ +#' \dontrun{ #' #' library(rxode2) #' library(units) @@ -32,16 +32,17 @@ #' ## These are making the more complex regimens of the rxode2 tutorial #' #' ## bid for 5 days -#' bid <- et(timeUnits="hr") %>% +#' bid <- et(timeUnits="hr") |> #' et(amt=10000,ii=12,until=set_units(5, "days")) #' #' ## qd for 5 days -#' qd <- et(timeUnits="hr") %>% +#' qd <- et(timeUnits="hr") |> #' et(amt=20000,ii=24,until=set_units(5, "days")) #' #' ## bid for 5 days followed by qd for 5 days #' -#' et <- seq(bid,qd) %>% et(seq(0,11*24,length.out=100)) +#' et <- seq(bid,qd) |> +#' et(seq(0,11*24,length.out=100)) #' #' bidQd <- rxSolve(mod1, et) #' @@ -51,11 +52,12 @@ #' ## Now Infusion for 5 days followed by oral for 5 days #' #' ## note you can dose to a named compartment instead of using the compartment number -#' infusion <- et(timeUnits = "hr") %>% +#' infusion <- et(timeUnits = "hr") |> #' et(amt=10000, rate=5000, ii=24, until=set_units(5, "days"), cmt="centr") #' #' -#' qd <- et(timeUnits = "hr") %>% et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot") +#' qd <- et(timeUnits = "hr") |> +#' et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot") #' #' et <- seq(infusion,qd) #' @@ -65,9 +67,10 @@ #' #' ## 2wk-on, 1wk-off #' -#' qd <- et(timeUnits = "hr") %>% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") +#' qd <- et(timeUnits = "hr") |> +#' et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") #' -#' et <- seq(qd, set_units(1,"weeks"), qd) %>% +#' et <- seq(qd, set_units(1,"weeks"), qd) |> #' add.sampling(set_units(seq(0, 5.5,by=0.005),weeks)) #' #' wkOnOff <- rxSolve(mod1, et) @@ -76,10 +79,11 @@ #' #' ## You can also repeat the cycle easily with the rep function #' -#' qd <-et(timeUnits = "hr") %>% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") +#' qd <-et(timeUnits = "hr") |> +#' et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") #' -#' et <- etRep(qd, times=4, wait=set_units(1,"weeks")) %>% -#' add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) +#' et <- etRep(qd, times=4, wait=set_units(1,"weeks")) |> +#' add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) #' #' repCycle4 <- rxSolve(mod1, et) #' diff --git a/man/add.dosing.Rd b/man/add.dosing.Rd index 8974a6cb3..1f08bf4c9 100644 --- a/man/add.dosing.Rd +++ b/man/add.dosing.Rd @@ -60,7 +60,7 @@ piping syntax through magrittr. It can also be accessed by \code{eventTable$add } \examples{ -\donttest{ +\dontrun{ library(rxode2) library(units) @@ -92,16 +92,17 @@ mod1 <-function(){ ## These are making the more complex regimens of the rxode2 tutorial ## bid for 5 days -bid <- et(timeUnits="hr") \%>\% +bid <- et(timeUnits="hr") |> et(amt=10000,ii=12,until=set_units(5, "days")) ## qd for 5 days -qd <- et(timeUnits="hr") \%>\% +qd <- et(timeUnits="hr") |> et(amt=20000,ii=24,until=set_units(5, "days")) ## bid for 5 days followed by qd for 5 days -et <- seq(bid,qd) \%>\% et(seq(0,11*24,length.out=100)) +et <- seq(bid,qd) |> + et(seq(0,11*24,length.out=100)) bidQd <- rxSolve(mod1, et) @@ -111,11 +112,12 @@ plot(bidQd, C2) ## Now Infusion for 5 days followed by oral for 5 days ## note you can dose to a named compartment instead of using the compartment number -infusion <- et(timeUnits = "hr") \%>\% +infusion <- et(timeUnits = "hr") |> et(amt=10000, rate=5000, ii=24, until=set_units(5, "days"), cmt="centr") -qd <- et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot") +qd <- et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot") et <- seq(infusion,qd) @@ -125,9 +127,10 @@ plot(infusionQd, C2) ## 2wk-on, 1wk-off -qd <- et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") +qd <- et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") -et <- seq(qd, set_units(1,"weeks"), qd) \%>\% +et <- seq(qd, set_units(1,"weeks"), qd) |> add.sampling(set_units(seq(0, 5.5,by=0.005),weeks)) wkOnOff <- rxSolve(mod1, et) @@ -136,10 +139,11 @@ plot(wkOnOff, C2) ## You can also repeat the cycle easily with the rep function -qd <-et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") +qd <-et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") -et <- etRep(qd, times=4, wait=set_units(1,"weeks")) \%>\% - add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) +et <- etRep(qd, times=4, wait=set_units(1,"weeks")) |> + add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) repCycle4 <- rxSolve(mod1, et) diff --git a/man/add.sampling.Rd b/man/add.sampling.Rd index 7b22b946b..05f352cd8 100644 --- a/man/add.sampling.Rd +++ b/man/add.sampling.Rd @@ -26,7 +26,7 @@ piping syntax through magrittr. It can also be accessed by } \examples{ -\donttest{ +\dontrun{ library(rxode2) library(units) @@ -58,16 +58,17 @@ mod1 <-function(){ ## These are making the more complex regimens of the rxode2 tutorial ## bid for 5 days -bid <- et(timeUnits="hr") \%>\% +bid <- et(timeUnits="hr") |> et(amt=10000,ii=12,until=set_units(5, "days")) ## qd for 5 days -qd <- et(timeUnits="hr") \%>\% +qd <- et(timeUnits="hr") |> et(amt=20000,ii=24,until=set_units(5, "days")) ## bid for 5 days followed by qd for 5 days -et <- seq(bid,qd) \%>\% et(seq(0,11*24,length.out=100)) +et <- seq(bid,qd) |> + et(seq(0,11*24,length.out=100)) bidQd <- rxSolve(mod1, et) @@ -77,11 +78,12 @@ plot(bidQd, C2) ## Now Infusion for 5 days followed by oral for 5 days ## note you can dose to a named compartment instead of using the compartment number -infusion <- et(timeUnits = "hr") \%>\% +infusion <- et(timeUnits = "hr") |> et(amt=10000, rate=5000, ii=24, until=set_units(5, "days"), cmt="centr") -qd <- et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot") +qd <- et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot") et <- seq(infusion,qd) @@ -91,9 +93,10 @@ plot(infusionQd, C2) ## 2wk-on, 1wk-off -qd <- et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") +qd <- et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") -et <- seq(qd, set_units(1,"weeks"), qd) \%>\% +et <- seq(qd, set_units(1,"weeks"), qd) |> add.sampling(set_units(seq(0, 5.5,by=0.005),weeks)) wkOnOff <- rxSolve(mod1, et) @@ -102,10 +105,11 @@ plot(wkOnOff, C2) ## You can also repeat the cycle easily with the rep function -qd <-et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") +qd <-et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") -et <- etRep(qd, times=4, wait=set_units(1,"weeks")) \%>\% - add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) +et <- etRep(qd, times=4, wait=set_units(1,"weeks")) |> + add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) repCycle4 <- rxSolve(mod1, et) diff --git a/man/assertCompartmentExists.Rd b/man/assertCompartmentExists.Rd index 2b570facb..3784cf354 100644 --- a/man/assertCompartmentExists.Rd +++ b/man/assertCompartmentExists.Rd @@ -33,6 +33,7 @@ Other Assertions: \code{\link{assertRxUi}()}, \code{\link{assertVariableExists}()}, \code{\link{assertVariableNew}()}, +\code{\link{testIniDf}()}, \code{\link{testRxUnbounded}()} } \author{ diff --git a/man/assertCompartmentName.Rd b/man/assertCompartmentName.Rd index d6e121f73..1ab647ffd 100644 --- a/man/assertCompartmentName.Rd +++ b/man/assertCompartmentName.Rd @@ -49,6 +49,7 @@ Other Assertions: \code{\link{assertRxUi}()}, \code{\link{assertVariableExists}()}, \code{\link{assertVariableNew}()}, +\code{\link{testIniDf}()}, \code{\link{testRxUnbounded}()} } \author{ diff --git a/man/assertCompartmentNew.Rd b/man/assertCompartmentNew.Rd index e62fa9703..47ceb0281 100644 --- a/man/assertCompartmentNew.Rd +++ b/man/assertCompartmentNew.Rd @@ -24,6 +24,7 @@ Other Assertions: \code{\link{assertRxUi}()}, \code{\link{assertVariableExists}()}, \code{\link{assertVariableNew}()}, +\code{\link{testIniDf}()}, \code{\link{testRxUnbounded}()} } \author{ diff --git a/man/assertRxUi.Rd b/man/assertRxUi.Rd index ee4d4e725..4dfdbdc86 100644 --- a/man/assertRxUi.Rd +++ b/man/assertRxUi.Rd @@ -103,6 +103,7 @@ Other Assertions: \code{\link{assertCompartmentNew}()}, \code{\link{assertVariableExists}()}, \code{\link{assertVariableNew}()}, +\code{\link{testIniDf}()}, \code{\link{testRxUnbounded}()} } \author{ diff --git a/man/assertVariableExists.Rd b/man/assertVariableExists.Rd index 2f657e098..7cad9157b 100644 --- a/man/assertVariableExists.Rd +++ b/man/assertVariableExists.Rd @@ -35,6 +35,7 @@ Other Assertions: \code{\link{assertCompartmentNew}()}, \code{\link{assertRxUi}()}, \code{\link{assertVariableNew}()}, +\code{\link{testIniDf}()}, \code{\link{testRxUnbounded}()} } \author{ diff --git a/man/assertVariableNew.Rd b/man/assertVariableNew.Rd index b596b60e5..d11298b97 100644 --- a/man/assertVariableNew.Rd +++ b/man/assertVariableNew.Rd @@ -24,6 +24,7 @@ Other Assertions: \code{\link{assertCompartmentNew}()}, \code{\link{assertRxUi}()}, \code{\link{assertVariableExists}()}, +\code{\link{testIniDf}()}, \code{\link{testRxUnbounded}()} } \author{ diff --git a/man/et.Rd b/man/et.Rd index 23c024ccb..558324ac1 100644 --- a/man/et.Rd +++ b/man/et.Rd @@ -163,7 +163,7 @@ Event Table Function } \examples{ -\donttest{ +\dontrun{ library(rxode2) library(units) @@ -195,16 +195,17 @@ mod1 <-function(){ ## These are making the more complex regimens of the rxode2 tutorial ## bid for 5 days -bid <- et(timeUnits="hr") \%>\% +bid <- et(timeUnits="hr") |> et(amt=10000,ii=12,until=set_units(5, "days")) ## qd for 5 days -qd <- et(timeUnits="hr") \%>\% +qd <- et(timeUnits="hr") |> et(amt=20000,ii=24,until=set_units(5, "days")) ## bid for 5 days followed by qd for 5 days -et <- seq(bid,qd) \%>\% et(seq(0,11*24,length.out=100)) +et <- seq(bid,qd) |> + et(seq(0,11*24,length.out=100)) bidQd <- rxSolve(mod1, et) @@ -214,11 +215,12 @@ plot(bidQd, C2) ## Now Infusion for 5 days followed by oral for 5 days ## note you can dose to a named compartment instead of using the compartment number -infusion <- et(timeUnits = "hr") \%>\% +infusion <- et(timeUnits = "hr") |> et(amt=10000, rate=5000, ii=24, until=set_units(5, "days"), cmt="centr") -qd <- et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot") +qd <- et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot") et <- seq(infusion,qd) @@ -228,9 +230,10 @@ plot(infusionQd, C2) ## 2wk-on, 1wk-off -qd <- et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") +qd <- et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") -et <- seq(qd, set_units(1,"weeks"), qd) \%>\% +et <- seq(qd, set_units(1,"weeks"), qd) |> add.sampling(set_units(seq(0, 5.5,by=0.005),weeks)) wkOnOff <- rxSolve(mod1, et) @@ -239,10 +242,11 @@ plot(wkOnOff, C2) ## You can also repeat the cycle easily with the rep function -qd <-et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") +qd <-et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") -et <- etRep(qd, times=4, wait=set_units(1,"weeks")) \%>\% - add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) +et <- etRep(qd, times=4, wait=set_units(1,"weeks")) |> + add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) repCycle4 <- rxSolve(mod1, et) diff --git a/man/etRbind.Rd b/man/etRbind.Rd index 5cc5e28ec..7b6389103 100644 --- a/man/etRbind.Rd +++ b/man/etRbind.Rd @@ -59,7 +59,7 @@ Combining event tables } \examples{ -\donttest{ +\dontrun{ library(rxode2) library(units) @@ -91,16 +91,17 @@ mod1 <-function(){ ## These are making the more complex regimens of the rxode2 tutorial ## bid for 5 days -bid <- et(timeUnits="hr") \%>\% +bid <- et(timeUnits="hr") |> et(amt=10000,ii=12,until=set_units(5, "days")) ## qd for 5 days -qd <- et(timeUnits="hr") \%>\% +qd <- et(timeUnits="hr") |> et(amt=20000,ii=24,until=set_units(5, "days")) ## bid for 5 days followed by qd for 5 days -et <- seq(bid,qd) \%>\% et(seq(0,11*24,length.out=100)) +et <- seq(bid,qd) |> + et(seq(0,11*24,length.out=100)) bidQd <- rxSolve(mod1, et) @@ -110,11 +111,12 @@ plot(bidQd, C2) ## Now Infusion for 5 days followed by oral for 5 days ## note you can dose to a named compartment instead of using the compartment number -infusion <- et(timeUnits = "hr") \%>\% +infusion <- et(timeUnits = "hr") |> et(amt=10000, rate=5000, ii=24, until=set_units(5, "days"), cmt="centr") -qd <- et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot") +qd <- et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot") et <- seq(infusion,qd) @@ -124,9 +126,10 @@ plot(infusionQd, C2) ## 2wk-on, 1wk-off -qd <- et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") +qd <- et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") -et <- seq(qd, set_units(1,"weeks"), qd) \%>\% +et <- seq(qd, set_units(1,"weeks"), qd) |> add.sampling(set_units(seq(0, 5.5,by=0.005),weeks)) wkOnOff <- rxSolve(mod1, et) @@ -135,10 +138,11 @@ plot(wkOnOff, C2) ## You can also repeat the cycle easily with the rep function -qd <-et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") +qd <-et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") -et <- etRep(qd, times=4, wait=set_units(1,"weeks")) \%>\% - add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) +et <- etRep(qd, times=4, wait=set_units(1,"weeks")) |> + add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) repCycle4 <- rxSolve(mod1, et) diff --git a/man/etRep.Rd b/man/etRep.Rd index f4401c1ff..a850e88e0 100644 --- a/man/etRep.Rd +++ b/man/etRep.Rd @@ -77,7 +77,7 @@ Repeat an rxode2 event table } \examples{ -\donttest{ +\dontrun{ library(rxode2) library(units) @@ -109,16 +109,17 @@ mod1 <-function(){ ## These are making the more complex regimens of the rxode2 tutorial ## bid for 5 days -bid <- et(timeUnits="hr") \%>\% +bid <- et(timeUnits="hr") |> et(amt=10000,ii=12,until=set_units(5, "days")) ## qd for 5 days -qd <- et(timeUnits="hr") \%>\% +qd <- et(timeUnits="hr") |> et(amt=20000,ii=24,until=set_units(5, "days")) ## bid for 5 days followed by qd for 5 days -et <- seq(bid,qd) \%>\% et(seq(0,11*24,length.out=100)) +et <- seq(bid,qd) |> + et(seq(0,11*24,length.out=100)) bidQd <- rxSolve(mod1, et) @@ -128,11 +129,12 @@ plot(bidQd, C2) ## Now Infusion for 5 days followed by oral for 5 days ## note you can dose to a named compartment instead of using the compartment number -infusion <- et(timeUnits = "hr") \%>\% +infusion <- et(timeUnits = "hr") |> et(amt=10000, rate=5000, ii=24, until=set_units(5, "days"), cmt="centr") -qd <- et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot") +qd <- et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot") et <- seq(infusion,qd) @@ -142,9 +144,10 @@ plot(infusionQd, C2) ## 2wk-on, 1wk-off -qd <- et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") +qd <- et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") -et <- seq(qd, set_units(1,"weeks"), qd) \%>\% +et <- seq(qd, set_units(1,"weeks"), qd) |> add.sampling(set_units(seq(0, 5.5,by=0.005),weeks)) wkOnOff <- rxSolve(mod1, et) @@ -153,10 +156,11 @@ plot(wkOnOff, C2) ## You can also repeat the cycle easily with the rep function -qd <-et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") +qd <-et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") -et <- etRep(qd, times=4, wait=set_units(1,"weeks")) \%>\% - add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) +et <- etRep(qd, times=4, wait=set_units(1,"weeks")) |> + add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) repCycle4 <- rxSolve(mod1, et) diff --git a/man/etSeq.Rd b/man/etSeq.Rd index 41720d95c..d92dc9b28 100644 --- a/man/etSeq.Rd +++ b/man/etSeq.Rd @@ -56,7 +56,7 @@ interval. } \examples{ -\donttest{ +\dontrun{ library(rxode2) library(units) @@ -88,16 +88,17 @@ mod1 <-function(){ ## These are making the more complex regimens of the rxode2 tutorial ## bid for 5 days -bid <- et(timeUnits="hr") \%>\% +bid <- et(timeUnits="hr") |> et(amt=10000,ii=12,until=set_units(5, "days")) ## qd for 5 days -qd <- et(timeUnits="hr") \%>\% +qd <- et(timeUnits="hr") |> et(amt=20000,ii=24,until=set_units(5, "days")) ## bid for 5 days followed by qd for 5 days -et <- seq(bid,qd) \%>\% et(seq(0,11*24,length.out=100)) +et <- seq(bid,qd) |> + et(seq(0,11*24,length.out=100)) bidQd <- rxSolve(mod1, et) @@ -107,11 +108,12 @@ plot(bidQd, C2) ## Now Infusion for 5 days followed by oral for 5 days ## note you can dose to a named compartment instead of using the compartment number -infusion <- et(timeUnits = "hr") \%>\% +infusion <- et(timeUnits = "hr") |> et(amt=10000, rate=5000, ii=24, until=set_units(5, "days"), cmt="centr") -qd <- et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot") +qd <- et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot") et <- seq(infusion,qd) @@ -121,9 +123,10 @@ plot(infusionQd, C2) ## 2wk-on, 1wk-off -qd <- et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") +qd <- et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") -et <- seq(qd, set_units(1,"weeks"), qd) \%>\% +et <- seq(qd, set_units(1,"weeks"), qd) |> add.sampling(set_units(seq(0, 5.5,by=0.005),weeks)) wkOnOff <- rxSolve(mod1, et) @@ -132,10 +135,11 @@ plot(wkOnOff, C2) ## You can also repeat the cycle easily with the rep function -qd <-et(timeUnits = "hr") \%>\% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") +qd <-et(timeUnits = "hr") |> + et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot") -et <- etRep(qd, times=4, wait=set_units(1,"weeks")) \%>\% - add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) +et <- etRep(qd, times=4, wait=set_units(1,"weeks")) |> + add.sampling(set_units(seq(0, 12.5,by=0.005),weeks)) repCycle4 <- rxSolve(mod1, et) diff --git a/man/linMod.Rd b/man/linMod.Rd index e3242238f..1b72580dd 100644 --- a/man/linMod.Rd +++ b/man/linMod.Rd @@ -102,6 +102,16 @@ Linear model to replace in rxode2 ui model linMod(x, 3) } +\seealso{ +Other User functions: +\code{\link{rxUdfUiData}()}, +\code{\link{rxUdfUiEst}()}, +\code{\link{rxUdfUiIniLhs}()}, +\code{\link{rxUdfUiMv}()}, +\code{\link{rxUdfUiNum}()}, +\code{\link{rxUdfUiParsing}()} +} \author{ Matthew L. Fidler } +\concept{User functions} diff --git a/man/rxEvid.Rd b/man/rxEvid.Rd index cbacbf7a3..70e769f1d 100644 --- a/man/rxEvid.Rd +++ b/man/rxEvid.Rd @@ -7,6 +7,7 @@ \alias{[.rxEvid} \alias{as.character.rxEvid} \alias{[[.rxEvid} +\alias{units<-.rxEvid} \alias{c.rxRateDur} \alias{format.rxEvid} \alias{format.rxRateDur} @@ -25,6 +26,8 @@ as.rxEvid(x) \method{[[}{rxEvid}(x, ...) +\method{units}{rxEvid}(x) <- value + \method{c}{rxRateDur}(x, ...) \method{format}{rxEvid}(x, ...) @@ -37,6 +40,8 @@ as.rxEvid(x) \item{x}{Item to be converted to a rxode2 EVID specification.} \item{...}{Other parameters} + +\item{value}{It will be an error to set units for evid} } \value{ rxEvid specification diff --git a/man/rxUdfUiData.Rd b/man/rxUdfUiData.Rd index c43dd2cc2..284d5369f 100644 --- a/man/rxUdfUiData.Rd +++ b/man/rxUdfUiData.Rd @@ -19,7 +19,17 @@ Return the data.frame that is being processed or setup data.frame for processing rxUdfUiData() +} +\seealso{ +Other User functions: +\code{\link{linMod}()}, +\code{\link{rxUdfUiEst}()}, +\code{\link{rxUdfUiIniLhs}()}, +\code{\link{rxUdfUiMv}()}, +\code{\link{rxUdfUiNum}()}, +\code{\link{rxUdfUiParsing}()} } \author{ Matthew L. Fidler } +\concept{User functions} diff --git a/man/rxUdfUiEst.Rd b/man/rxUdfUiEst.Rd index c06b705cc..fbcde6a43 100644 --- a/man/rxUdfUiEst.Rd +++ b/man/rxUdfUiEst.Rd @@ -20,7 +20,17 @@ Return the current estimation method for the UI processing rxUdfUiEst() +} +\seealso{ +Other User functions: +\code{\link{linMod}()}, +\code{\link{rxUdfUiData}()}, +\code{\link{rxUdfUiIniLhs}()}, +\code{\link{rxUdfUiMv}()}, +\code{\link{rxUdfUiNum}()}, +\code{\link{rxUdfUiParsing}()} } \author{ Matthew L. Fidler } +\concept{User functions} diff --git a/man/rxUdfUiIniLhs.Rd b/man/rxUdfUiIniLhs.Rd index 2c45a4d41..1b65b69f5 100644 --- a/man/rxUdfUiIniLhs.Rd +++ b/man/rxUdfUiIniLhs.Rd @@ -16,7 +16,17 @@ Return the lhs parsed language expression rxUdfUiIniLhs() +} +\seealso{ +Other User functions: +\code{\link{linMod}()}, +\code{\link{rxUdfUiData}()}, +\code{\link{rxUdfUiEst}()}, +\code{\link{rxUdfUiMv}()}, +\code{\link{rxUdfUiNum}()}, +\code{\link{rxUdfUiParsing}()} } \author{ Matthew L. Fidler } +\concept{User functions} diff --git a/man/rxUdfUiMv.Rd b/man/rxUdfUiMv.Rd index d6c9989c1..588f79148 100644 --- a/man/rxUdfUiMv.Rd +++ b/man/rxUdfUiMv.Rd @@ -22,7 +22,17 @@ variables for processing rxUdfUiMv() +} +\seealso{ +Other User functions: +\code{\link{linMod}()}, +\code{\link{rxUdfUiData}()}, +\code{\link{rxUdfUiEst}()}, +\code{\link{rxUdfUiIniLhs}()}, +\code{\link{rxUdfUiNum}()}, +\code{\link{rxUdfUiParsing}()} } \author{ Matthew L. Fidler } +\concept{User functions} diff --git a/man/rxUdfUiNum.Rd b/man/rxUdfUiNum.Rd index ad161016a..07a5f5e48 100644 --- a/man/rxUdfUiNum.Rd +++ b/man/rxUdfUiNum.Rd @@ -17,8 +17,17 @@ UI functions \examples{ rxUdfUiNum() - +} +\seealso{ +Other User functions: +\code{\link{linMod}()}, +\code{\link{rxUdfUiData}()}, +\code{\link{rxUdfUiEst}()}, +\code{\link{rxUdfUiIniLhs}()}, +\code{\link{rxUdfUiMv}()}, +\code{\link{rxUdfUiParsing}()} } \author{ Matthew L. Fidler } +\concept{User functions} diff --git a/man/rxUdfUiParsing.Rd b/man/rxUdfUiParsing.Rd index 53ecb6949..eab3e5877 100644 --- a/man/rxUdfUiParsing.Rd +++ b/man/rxUdfUiParsing.Rd @@ -15,6 +15,16 @@ Returns if the current ui function is being parsed \examples{ rxUdfUiParsing() } +\seealso{ +Other User functions: +\code{\link{linMod}()}, +\code{\link{rxUdfUiData}()}, +\code{\link{rxUdfUiEst}()}, +\code{\link{rxUdfUiIniLhs}()}, +\code{\link{rxUdfUiMv}()}, +\code{\link{rxUdfUiNum}()} +} \author{ Matthew L. Fidler } +\concept{User functions} diff --git a/man/testIniDf.Rd b/man/testIniDf.Rd index aa0713a4b..a82d79451 100644 --- a/man/testIniDf.Rd +++ b/man/testIniDf.Rd @@ -36,6 +36,17 @@ This function tests if this object is a iniDf as needed by the UI \examples{ testIniDf(TRUE) } +\seealso{ +Other Assertions: +\code{\link{assertCompartmentExists}()}, +\code{\link{assertCompartmentName}()}, +\code{\link{assertCompartmentNew}()}, +\code{\link{assertRxUi}()}, +\code{\link{assertVariableExists}()}, +\code{\link{assertVariableNew}()}, +\code{\link{testRxUnbounded}()} +} \author{ Matthew L. Fidler } +\concept{Assertions} diff --git a/man/testRxUnbounded.Rd b/man/testRxUnbounded.Rd index bf914828f..21b013508 100644 --- a/man/testRxUnbounded.Rd +++ b/man/testRxUnbounded.Rd @@ -65,7 +65,8 @@ Other Assertions: \code{\link{assertCompartmentNew}()}, \code{\link{assertRxUi}()}, \code{\link{assertVariableExists}()}, -\code{\link{assertVariableNew}()} +\code{\link{assertVariableNew}()}, +\code{\link{testIniDf}()} } \author{ Matthew L. Fidler