Skip to content

Commit

Permalink
Fix rxControl requirements for pknca
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Aug 17, 2023
1 parent 487c702 commit 1feb3e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion R/pknca.R
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,15 @@ getDvLines <- function(modelfun, inModel = FALSE, dvAssign = NULL) {
#' @noRd
calcPknca <- function(env, pkncaUnits) {
# Normalize column names
rxControl <- env$control[[1]]$rxControl
control <- env$control[[1]]
rawData <- env$data

if (!is.null(control$ncaData)) {
# as.data.frame() due to https://github.com/nlmixr2/nlmixr2est/pull/262
rawData <- as.data.frame(control$ncaData)
}
cleanData <- bblDatToPknca(model = env$ui, data = rawData, rxControl=env$control$rxControl)
cleanData <- bblDatToPknca(model = env$ui, data = rawData, rxControl=rxControl)
cleanColNames <- getStandardColNames(cleanData$obs)
oConcFormula <-
stats::as.formula(sprintf(
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-pknca.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ test_that("pkncaControl", {
groups = "foo",
sparse = FALSE,
ncaData = NULL,
ncaResults = NULL
ncaResults = NULL,
rxControl= rxode2::rxControl()
)
)

Expand Down

0 comments on commit 1feb3e7

Please sign in to comment.