pharmr is an R wrapper to Pharmpy:
an open-source software package for pharmacometric modeling. It provides
an R interface to all functions found in the modeling
and
tools
modules (documented here). The
documentation for each function is also available via the
help
-function (or ?
).
For comprehensive information and documentation, see: https://pharmpy.github.io
The latest stable version of pharmr is available via CRAN, and can be installed via:
install.packages("pharmr")
After installing pharmr, Pharmpy needs to be set up:
::install_pharmpy() pharmr
For a more comprehensive description of the process of setting up, see the following guide.
It is also possible to install the development version of pharmr from GitHub, with the following command:
::install_github("pharmpy/pharmr", ref="main") remotes
Pharmpy can then be installed:
::install_pharmpy() pharmr
>>> library(pharmr)
>>> model <- load_example_model("pheno")
>>> model$parameters
value lower upper fix0.004693 0.00 ∞ False
POP_CL 1.009160 0.00 ∞ False
POP_VC 0.100000 -0.99 ∞ False
COVAPGR 0.030963 0.00 ∞ False
IIV_CL 0.031128 0.00 ∞ False
IIV_VC 0.013086 0.00 ∞ False
SIGMA >>> res <- load_example_modelfit_results("pheno")
>>> res$parameter_estimates
POP_CL POP_VC COVAPGR IIV_CL IIV_VC SIGMA 0.00469555 0.98425800 0.15892000 0.02935080 0.02790600 0.01324100
>>>
A simple example of reading a model, performing a simple transformation, and running the model in NONMEM. Note that you need NONMEM installed to be able to fit the model, see the following guide on how to set up the config file.
<- load_example_model('pheno') %>%
model add_peripheral_compartment() %>%
fit()