Laboratory of Applied Pharmacokinetics and Bioinformatics
Optimizing drug therapy for populations and individuals

Click the logo to return to Pmetrics home page.
Pmetrics has evolved from decades of work. Please consider a donation to help support continued development. Thank you!
Package Installation Examples Tips and Tricks

Pmetrics Package Top

Current version: 1.5.0 What's new?

Email us to get Pmetrics for MacOSX

Email us to get Pmetrics for Windows

Installation Top

Step 1: Install R

R is a freely available statistical software package and programming languange available for Windows, Unix (Mac) and Linux systems. Pmetrics is an add-on package for R. Click the R icon to be linked to the Comprehensive R Archive Network (CRAN) and download the appropriate version for your system.

Step 2 (optional): Install an R interface

Although R comes with a basic graphical user interface for writing scripts, there are other options. We prefer Rstudio, which is an excellent cross-platform environment for R. You can get it by clicking their logo. If you prefer to use the native R GUI or another, that is fine too.

Step 3: Download Pmetrics from our website

If you have not done it already, obtain the Pmetrics package. Do NOT open the archive (.zip or .tgz) file directly. R needs the package to be in this archived format to install properly in Step 6.

Step 4: Get Fortran

Pmetrics needs Fortran to work. We support gfortran, which is free; however, if you have another Fortran installation on your system, email us for help.
Be sure to follow the instructions carefully for your specific system below.



Step 5: Java

As of Pmetrics 1.5.0, you no longer need Java.

Step 6: Launch R and install Pmetrics

Open Rstudio or the R GUI of your choice. Follow the appropriate procedure to install, depending on your software as below.

Rstudio (Mac or Windows)


Windows R GUI

You can also use R scripting, although in Rstudio this sometimes (unpredictably) fails. Type the following command into the R console window (don't know what that means?):


A file chooser window will open and you can select the Pmetrics unextracted archive file that we sent you. On Mac systems, this will be a Pmetrics_xx.tgz file, and on Windows it will be a file, where xx is the version number, which is currently 1.5.0.

Step 7: PMbuild()

Pmetrics uses Fortran to compile code to run population model fitting and simulations. When you first load Pmetrics in R with the library(Pmetrics) command, the next command you should run is PMbuild(). This will attempt to compile the required, included, Fortran modules. There are many Fortran compilers available, so Pmetrics will ask you which Fortran compiler is installed on your system. If you don't have one, you will be linked to a page on our website with step-by-step instructions on how to get and install a specific version of gfortran (free) for your system. If you neglect to run PMbuid(), when you first load Pmetrics, then the first time you use a command in Pmetrics that requires Fortran, e.g. NPrun(), ITrun(), ERRrun(), SIMrun(), you will be asked to supply the type of Fortran compiler you have and prompted to run PMbuild().

Step 8: Check your installation with PMtest()

As of version 1.2.9, the function PMtest() will allow you to determine if you have installed all the necessary components to run Pmetrics. If you have not properly installed and loaded Pmetrics, installed and identified your fortran compiler, and run PMbuild(), you will get an error report when you run PMtest().

Step 9: Work through the example files

To start using Pmetrics, be sure to download the example script, model file, data files, and instruction files from the Example Section. Do also carefully read the User Manual!

Step 10: That's it!

Hopefully, you have been able to successfully install all the required components. Please use the LAPK Forum if you are having problems.

Examples Top

If you are new to Pmetrics, download a zip file containing an example R script, data .csv file, and fortran model file to run Pmetrics.

Tips and Tricks Top

Here are some things that you can do to make Pmetrics run the way you want it to.

  1. Once Pmetrics is installed into R, load it at the beginning of each R session with the command: library(Pmetrics).
  2. Use the Pmetrics command PMtree() to set up a new project folder tree. You can get help on this command and all Pmetrics commands in R by typing ?command, e.g. ?PMtree
  3. R and Pmetrics are case-sensitive! Capitals matter.
  4. You can change some options in Pmetrics. See ?setPMoptions for help in R.