nlmixrdevelopment / nlmixr

nlmixr: an R package for population PKPD modeling
https://nlmixrdevelopment.github.io/nlmixr/
GNU General Public License v2.0
115 stars 45 forks source link

Error: 'rxSolve.default' is not an exported object from 'namespace:RxODE #477

Closed sujit541 closed 3 years ago

sujit541 commented 3 years ago

fit.1cpt.ode.saem <- nlmixr(model.1cpt.ode, PKdata, est="saem", table=tableControl(cwres=TRUE, npde=TRUE)) Compiling RxODE equations...done. Building SAEM model...done Error: 'rxSolve.default' is not an exported object from 'namespace:RxODE'

mattfidler commented 3 years ago

Hi @sujit541

This would occur on any model, if true; My guess is you have a nlmixr that is not compatible with the version of RxODE you have installed. The new version of nlmixr will not even load if it isn't compiled against the correct version of RxODE.

Can you post your session information?

sujit541 commented 3 years ago

sessionInfo() R version 3.6.0 (2019-04-26) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached): [1] Rcpp_1.0.5 pillar_1.4.4
[3] compiler_3.6.0 PreciseSums_0.3
[5] tools_3.6.0 mvnfast_0.2.5
[7] digest_0.6.25 nlme_3.1-148
[9] huxtable_5.0.0 memoise_1.1.0
[11] lifecycle_0.2.0 tibble_3.0.1
[13] gtable_0.3.0 lattice_0.20-41
[15] pkgconfig_2.0.3 rlang_0.4.6
[17] cli_2.0.2 rstudioapi_0.11
[19] parallel_3.6.0 xfun_0.14
[21] RcppArmadillo_0.9.900.1.0 n1qn1_6.0.1-7
[23] nlmixr_1.1.1-3 dplyr_1.0.0
[25] knitr_1.28 lbfgs_1.2.1
[27] generics_0.0.2 vctrs_0.3.1
[29] grid_3.6.0 tidyselect_1.1.0
[31] glue_1.4.1 data.table_1.12.8
[33] R6_2.4.1 fansi_0.4.0
[35] ggplot2_3.3.1 purrr_0.3.4
[37] dparser_0.1.8 magrittr_2.0.1
[39] vpc_1.2.1 scales_1.1.1
[41] ellipsis_0.3.1 units_0.6-7
[43] assertthat_0.2.1 RxODE_0.9.2-0
[45] colorspace_1.4-1 brew_1.0-6
[47] lotri_0.2.2 munsell_0.5.0
[49] crayon_1.3.4

sujit541 commented 3 years ago

Please let me know the update

sujit541 commented 3 years ago

Detail code as follows

> model.1cpt.ode <- function() {
+   ini({
+     tka <- c(-1,0.2,2)
+     tcl <- log(7.57)
+     tv  <- log(40.35)
+     eta.ka ~ 0.1
+     eta.cl ~ 1
+     eta.v ~ 1
+     add.err <- 0.1
+   })
+   model({
+     ka <- exp(tka + eta.ka)
+     cl <- exp(tcl + eta.cl)
+     v <- exp(tv + eta.v)
+     d/dt(depot) = -ka * depot
+     d/dt(center) = ka * depot - cl / v * center
+     cp = center / v
+     cp ~ add(add.err)
+   })
+ }
> fit.1cpt.ode.saem <- nlmixr(model.1cpt.ode, PKdata, est="saem", table=tableControl(cwres=TRUE, npde=TRUE))
Compiling RxODE equations...done.
Building SAEM model...done
Error: 'rxSolve.default' is not an exported object from 'namespace:RxODE'
mattfidler commented 3 years ago

The easiest to fix this in windows is to use the nlmixr installer:

https://github.com/nlmixrdevelopment/nlmixr/releases/tag/v1.1.1-3

Otherwise you can try to re-install from github:

install.packages("remotes") # if needed
remotes::install_github("nlmixrdevelopment/RxODE")
remotes::install_github("nlmixredelopment/nlmixr")
mattfidler commented 3 years ago

This isn't really a bug, so I'm moving this to discussions