Warning
This is a development branch of Pmetrics using a new backend written in Rust. The repository for the current stable release is LAPKB/Pmetrics.
Thank you for your interest in Pmetrics, created by the Laboratory of Applied Pharmacokinetics and Bioinformatics. Pmetrics is a library package for R to perform non-parametric and parametric pharmacokinetic-pharmacodynamic population and individual modeling and simulation. It is primarily designed for pharmacometric researchers.
Pmetrics is based on over 40 years of research by our laboratory and is the most mature non-parametric method available. Nevertheless, Pmetrics is dynamically evolving. Best of all, it is SHAREWARE with only a suggested donation.
The open source code for the Pmetrics R package is hosted here on Github. LAPKB has developed two other packages, PMcore and pharmsol, which implement the core algorithms used by Pmetrics. These packages are also open source and available on Github.
To install and use Pmetrics, you will need R, Rust, and the Pmetrics package appropriate for your system.
![]()
You can download and install R from the Comprehensive R Archive
Network (CRAN). In addition, we strongly
recommend a third-party integrated development environment (IDE) to use
R and Pmetrics rather than the rudimentary IDE that comes with R. We use
all the IDEs below when developing and working with Pmetrics.
- RStudio is the oldest and most stable IDE, developed by Posit. Most users who only program in R use Rstudio. It has a simple interface with many R-specific buttons and menus. It is relatively easy to learn and use, but does not support other programming languages.
- Positron is a newer alternative also from Posit. Posit are now mostly developing Positron rather than Rstudio. Positron primarily supports users who work in R and Python. However, it is built upon VS Code, which gives Positron access to thousands of extensions, including multiple AI tools to assist with coding and data analysis, and Positron can support additional programming languages. It is far more powerful than Rstudio, but has a steeper learning curve and currently fewer R-specific buttons and menus. VS Code users will find Positron familiar.
- VS Code itself can be used for R, but it is best suited for experienced coders who also use other programming languages.
![]()
Rust is the language used by pharmsol for the backend of Pmetrics
and all the heavy “number crunching”. Rust is modern, fast, reliable,
widely used, and extremely well supported. It works on all major
operating systems.
Follow the instructions on the Rust website to install Rust on your system.
![]()
The compiled versions of Pmetrics for MacOS, Windows and Linux are
hosted on r-universe. Follow
these easy steps to install the correct version for your system.
-
Add the LAPKB r-universe repository to your list of repositories by adding this code to your
.Rprofilescript, which ensures that R will always include the LAPKB repository when installing or updating packages, even after you restart or update R.options(repos = c( CRAN = "https://cloud.r-project.org", LAPKB = "https://lapkb.r-universe.dev" ))
If you don’t have an
.Rprofilescript, you can create one in your home directory. This only needs to be done once.Mac
You can create or edit the
.Rprofilefile using TextEdit or any text editor. Make sure to save it as a plain text file named.Rprofilein your home directory, i.e.,/Users/yourusername/.Rprofile. Do not add a.txtextension. To open/edit your.Rprofilelater, typeopen -e ~/.Rprofilein the Terminal.Windows
You can create or edit the
.Rprofilefile using Notepad or any text editor. Make sure to save it as a plain text file named.Rprofilein your home directory, i.e.,C:\Users\yourusername\.Rprofile. Do not add a.txtextension. To open/edit your.Rprofilelater, typenotepad %USERPROFILE%\.Rprofilein the Command Prompt.Linux
You can create or edit the
.Rprofilefile using any text editor, such asnanoorvim. Make sure to save it as a plain text file named.Rprofilein your home directory, i.e.,/home/yourusername/.Rprofile. To open/edit your.Rprofilelater, typenano ~/.Rprofileorvim ~/.Rprofilein the terminal. -
After you have run the above command once, you can install or update previously installed Pmetrics by running this command in R:
install.packages("Pmetrics")This command is the same as for any other R package hosted on CRAN. By having the LAPKB repository in your list of repositories, R will automatically find and install/update the correct version of Pmetrics for your system.
What if I couldn’t add the LAPKB repository to my .Rprofile?
You can still install Pmetrics by specifying the repository directly in the
install.packagesfunction like this:install.packages("Pmetrics", repos = "https://lapkb.r-universe.dev")
However, you will need to include the
reposargument each time you want to install or update Pmetrics.
We encourage you to visit our website to learn about Pmetrics.
