Skip to content

Commit

Permalink
Merge branch 'main' into 603-using-$ini-$inidf-and-model-related-line…
Browse files Browse the repository at this point in the history
…s-for-assignment
  • Loading branch information
mattfidler committed Nov 29, 2023
2 parents 210fa8c + dbb5391 commit a821a0d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
- "dop853" now uses the `hmax`/`h0` values from the `rxControl()` or
`rxSolve()`. This may change some ODE solving using "dop853"

- When not specified (and xgxr is available), the x axis is no longer
assumed to be in hours

## New features

- User defined functions can now be R functions. For many of these R
Expand Down Expand Up @@ -163,6 +166,10 @@ mu-referencing style to run the optimization.
- Bug fix for some covariate updates that may affect multiple compartment
models (like issue #581)

## Maintenance fixes

- Modify plot code to work with development `xgxr`

# rxode2 2.0.14

- CRAN requested that FORTRAN `kind` be changed as it was not portable;
Expand Down
28 changes: 27 additions & 1 deletion R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ rxTheme <- function(base_size = 11, base_family = "",
if (!.xgxr) {
return(NULL)
}
if (is.null(.unit)) {
return(NULL)
}
.timex <- xgxr::xgx_scale_x_time_units(.unit)
if (inherits(.timex, "list")) {
.w <- which(sapply(seq_along(.timex), function(x) {
Expand All @@ -134,11 +137,34 @@ rxTheme <- function(base_size = 11, base_family = "",
}
if (inherits(.dat$time, "units")) {
.unit <- as.character(units(.dat$time))
.unitNames <- c(s="second",
sec="second",
second="second",
min="minute",
minute="minute",
h="hour",
hr="hour",
hour="hour",
d="day",
day="day",
days="day",
week="week",
weeks="week",
month="month",
months="month",
year="year",
years="year",
yr="year")
.unit <- setNames(.unitNames[.unit], NULL)
if (is.na(.unit)) {
.timex <- .xgxrT(NULL)
.xlab <- xlab(xlab)
}
.dat$time <- .dropUnits(.dat$time)
.timex <- .xgxrT(.unit)
.xlab <- xlab(sprintf("%s [%s]", xlab, .unit))
} else {
.timex <- .xgxrT("h")
.timex <- .xgxrT(NULL)
.xlab <- xlab(xlab)
}
list(timex=.timex, xlab=.xlab, dat=.dat)
Expand Down
2 changes: 1 addition & 1 deletion src/par_solve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ extern "C" SEXP _rxProgressAbort(SEXP str){
par_progress_0=0;
if (rxt.d != rxt.n || rxt.cur != rxt.n){
rxSolveFreeC();
Rf_errorcall(R_NilValue, CHAR(STRING_ELT(str,0)));
Rf_errorcall(R_NilValue, "%s", CHAR(STRING_ELT(str,0)));
}
return R_NilValue;
}
Expand Down

0 comments on commit a821a0d

Please sign in to comment.