Installing nlmixr"

nlmixr

Windows installer

For those not interested in customized installation on Windows, we recommend you download a Windows installer for your platform from the following link: https://github.com/nlmixrdevelopment/nlmixr/releases/tag/v0.9.0-2

Installation on Windows

To replicate the environment that was used in Windows for nlmixr development, you will need administrator rights, and you should perform the following steps:

  1. Install R 3.4.1 (or later) from the R website.
  2. For best results, we suggest you use C:\R\R-3.4.1, but you can also use the default location (C:\Program Files\R\R-3.4.1) as well, if really needed.
  3. For 64-bit Windows, it is best practice to include only the 64-bit version. If you include 32-bit files, some packages may not run correctly. Additionally, both the 32- and 64-bit binaries have to be compiled for every package. Similarly, if on 32-bit Windows, install only the 32-bit version of R (and Python, and Rtools).
  4. Install the appropriate version of Rtools for Windows, currently version 3.4, from here.
  5. This is an absolute requirement, since it includes C++ and related compilers not usually available under Windows.
  6. For best results, use the default location of c:\Rtools
    • RxODE, a required component of nlmixr, checks and sets up the path based on the following: a. Rtools is in the path (fastest and recommended option) b. Rtools was installed with information saved to the Windows registry, and RxODE can find the installation. c. Rtools is on a hard drive installed in either Rtools or RBuildTools
    • If you are on 64-bit windows, please do not install the R 3.3.x 32-bit toolchain. These files can interfere with some packages that compile binaries, with unpredictable consequences. Similarly, only install 32-bit Rtools on 32-bit versions of Windows.
  7. Make sure the compilers have been added to the Windows PATH environment variable, or RxODE and nlmixr will not work (this should be done automatically during installation).
  8. Install a version of Python for Windows.
  9. This is used for its symbolic algebra package SymPy.
  10. A very robust Python distribution that includes SymPy and many packages that may be useful to the data scientist and/or pharmacometrician is Anaconda. Although very straightforward and easy to install, it is quite a large download and contains much more than you will need to run nlmixr. When installing, use the Python 3.6 version. During the installation, Anaconda provides the option of adding itself to the PATH environment variable, but advises against it; please do this anyway (despite the red warning).
  11. Another option is to use official Python, although you will need to install SymPy separately if you go this route, which is sometimes not straightforward under Windows 10 owing to folder permissions (see here for a few workarounds). Nonetheless, see here for instructions for installation from source or using pip. Note that if you approach us for support, we are going to recommend that you use Anaconda.
  12. Regardless of the option you choose, please use like with like (64-bit Python for 64-bit Windows, for example).
  13. Once again, make sure Python has been added to the Windows PATH environment variable, or RxODE and nlmixr will not work, no matter what Anaconda might say.
  14. Install devtools.
  15. This package is required to install packages from Github, amongst other things.
  16. This can be done from a clean R session by install.packages("devtools").
  17. Load devtools using library(devtools).
  18. Install RxODE.
  19. Currently the new version of RxODE is in the process of being uploaded to CRAN. nlmixr needs this newer version of RxODE to function correctly. To install this version, use the command: install_github("nlmixrdevelopment/RxODE").
  20. Once installed, type RxODE::rxWinPythonSetup() to install the required package SnakeCharmRand to make sure Python and SymPy are working properly.
  21. Restart your R session.
  22. As a quick test, you can make sure that R and Python can communicate by typing the command library(SnakeCharmR).
  23. To validate or test the installation of RxODE completely, you can type the following library(RxODE); rxTest(); and it will run all of the unit tests in RxODE to make sure it is running correctly on your system. (Note that the testthat package is required for this, and it will take a long time.)
  24. Install nlmixr.
  25. Load devtools again using library(devtools)
  26. Install nlmixr by running install_github("nlmixrdevelopment/nlmixr")

Installation on Linux

Instructions for Ubuntu-alike distributions are given here (specifically, Ubuntu 16.04 Xenial Xerus), but all current Linux distributions are supported, in principle.

  1. Install R 3.4.1 (or later) from an appropriate repository (Ubuntu Xenial shown below, based on instructions provided here).
  2. You will need administrator privileges (i.e. access to sudo). Provide your admin password when asked.
  3. Add the official CRAN repository for Ubuntu: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
  4. Add the official CRAN repository for Ubuntu: sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'. If you aren't using Ubuntu Xenial, change xenial to match your distribution's codename.
  5. Now refresh the package list using sudo apt-get update.
  6. We can now install base R and required development libraries, and their dependencies: sudo apt-get install r-base r-base-dev libssl-dev
  7. Install Python dependencies.
  8. Enter this: sudo apt-get install python-sympy python-pip python-setuptools python3-pip python-dev python3-dev.
  9. Install devtools and dependencies.
  10. This package is required to install packages from Github, amongst other things.
  11. Some Linux distributions don't include build tools out of the box. To be safe, check this: sudo apt-get install build-essential
  12. Install devtools from a clean R session by entering install.packages("devtools").
  13. In R, load devtools using library(devtools).
  14. Install RxODE.
  15. Currently the new version of RxODE is in the process of being uploaded to CRAN. nlmixr needs this newer version of RxODE to function correctly. To install this version, use the command: install_github("nlmixrdevelopment/RxODE").
  16. Install SnakeCharmR using install_github("nlmixrdevelopment/SnakeCharmR").
  17. Restart your R session.
  18. As a quick test, you can make sure that R and Python can communicate by typing the command library(SnakeCharmR).
  19. To validate or test the installation of RxODE completely, you can type the following library(RxODE); rxTest(); and it will run all of the unit tests in RxODE to make sure it is running correctly on your system. (Note that the testthat package is required for this, and it will take a long time.)
  20. Install nlmixr.
  21. This can be done by install_github("nlmixrdevelopment/nlmixr")

Installation on macOS

Instructions for macOS 10.12 Sierra are provided here. They should be broadly extensible to all recent releases of macOS, however.

  1. Install R 3.4.1 (or later) from the R website.
  2. Download and install R-3.4.1.pkg (or later) from CRAN.
  3. Install Python dependencies.
  4. Install pip from the macOS terminal prompt: sudo easy_install pip.
  5. Install sympy using pip: sudo -H pip install sympy.
  6. Install devtools and dependencies.
  7. This package is required to install packages from Github, amongst other things.
  8. Install devtools from a clean R session by entering install.packages("devtools").
  9. In R, load devtools using library(devtools).
  10. Install build tools.
  11. Install Xcode from the App Store.
  12. Read the license by entering the following at the macOS terminal: sudo xcodebuild -license
  13. Scroll through it all, reading it carefully, and type agree at the end. (If you don't, you can't use nlmixr or anything else that requires compilation on macOS. Don't yell at us, yell at Apple.)
  14. Install gfortran: download the appropriate macOS installer from here and run it.
  15. Install RxODE.
  16. Currently the new version of RxODE is in the process of being uploaded to CRAN. nlmixr needs this newer version of RxODE to function correctly. To install this version, use the command: install_github("nlmixrdevelopment/RxODE").
  17. Install SnakeCharmR using install_github("nlmixrdevelopment/SnakeCharmR").
  18. Restart your R session.
  19. As a quick test, you can make sure that R and Python can communicate by typing the command library(SnakeCharmR).
  20. To validate or test the installation of RxODE completely, you can type the following library(RxODE); rxTest(); and it will run all of the unit tests in RxODE to make sure it is running correctly on your system. (Note that the testthat package is required for this, and it will take a long time.)
  21. Install nlmixr.
  22. This can be done by install_github("nlmixrdevelopment/nlmixr")


Try the nlmixr package in your browser

Any scripts or data that you put into this service are public.

nlmixr documentation built on Sept. 23, 2018, 5:04 p.m.