Skip to content

Commit

Permalink
Merge pull request #799 from nlmixr2/doc-pkgdown-fix
Browse files Browse the repository at this point in the history
Documentation and pkgdown fix
  • Loading branch information
mattfidler authored Oct 25, 2024
2 parents a19a30c + 8451d36 commit 591f0f0
Show file tree
Hide file tree
Showing 29 changed files with 231 additions and 87 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions R/assert.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion R/et.R
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
14 changes: 8 additions & 6 deletions R/linMod.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ rxUdfUi.default <- function(fun) {
#' `rxUdfUi()` for details.
#'
#' @export
#'
#' @family User functions
#' @author Matthew L. Fidler
#'
#' @examples
#'
#' linMod(x, 3)
Expand Down Expand Up @@ -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)
}
}
Expand Down
7 changes: 6 additions & 1 deletion R/rudfui.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -87,6 +88,7 @@ rxUdfUiIniLhs <- function() {
#'
#' @return value of the `modelVariables` being processed or `NULL`.
#'
#' @family User functions
#' @export
#' @author Matthew L. Fidler
#' @examples
Expand All @@ -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
#'
Expand All @@ -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
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ reference:
- rxUiCompress
- rxUiDecompress
- rxode2<-
- testIniDf
- testRxLinCmt
- testRxUnbounded
- update.rxUi
Expand Down Expand Up @@ -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
Expand Down
26 changes: 15 additions & 11 deletions man-roxygen/etExamples.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' @examples
#'
#' \donttest{
#' \dontrun{
#'
#' library(rxode2)
#' library(units)
Expand Down Expand Up @@ -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)
#'
Expand All @@ -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)
#'
Expand All @@ -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)
Expand All @@ -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)
#'
Expand Down
26 changes: 15 additions & 11 deletions man/add.dosing.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 15 additions & 11 deletions man/add.sampling.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/assertCompartmentExists.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/assertCompartmentName.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/assertCompartmentNew.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/assertRxUi.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/assertVariableExists.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 591f0f0

Please sign in to comment.