Please read the appropriate sections below, which give specific instructions for installing and testing the pomp software and other packages we will be using for data analysis using POMP models. First follow the instructions for “all users”, then those for your specific operating system (OS).

Important note: If you run into problems, email with a detailed description of the problem you’ve encountered. In this message, be certain to include all of the following information:

In particular, it is often easiest to send a screenshot or transcript showing the commands you’ve entered and the error messages you’ve received. In R, you can run Sys.info() to get a printout of the operating system and software version numbers.

All users

Install R and RStudio

You’ll need at least version 4.3.1 of R. Source code and binaries are available on CRAN (https://cran.r-project.org/). Install the latest version of RStudio from rstudio.com.

Install needed packages

Open a session in RStudio and run the following:

> update.packages()
> source("https://ionides.github.io/531w24/pomp_prep/packages.R")

[The > is the command prompt; it is not part of the command. Also, depending on your email client propgram, you may need to replace the quotation marks with plain keyboard double quotes.]

The first command updates your installed packages. You may be prompted to specify a CRAN mirror: choose one geographically near you. In RStudio, you can also push the “Update” button on the “Packages” tab to accomplish this.

The second command runs a script on my website. It will install some needed packages if these are not already installed on your system.


Windows users

If your machine runs Windows, you must install Rtools. This will give you the ability to compile C code and dynamically link it into an R session.

Download Rtools from CRAN and install it. A video tutorial demonstrating how to install Rtools may be helpful. Also, detailed installation instructions are available on CRAN. Note that, after installation, there is one more step to be completed.


MacOSX users

So that you can compile C code and dynamically link it into an R session, you will need to have the Xcode app installed. This is gratis and can be installed via the App Store or downloaded from developer.apple.com. Video tutorials demonstrating how to check if you need to install Xcode, how to install Xcode, and how to install pomp once you have installed Xcode are available.

Note that you must go beyond merely installing the Xcode app. After you’ve installed the app, open a unix terminal (listed as the Terminal app under “Utilities” in the Finder) and run the following line

xcode-select --install

This will install the “Command Line Tools” that are needed to compile native C codes. Running this command is tantamount to the part of the Xcode installation tutorial video where we complete the installation using the graphical user interface.


All users

Test pomp

Open a session in RStudio and run the following:

> source("https://kingaa.github.io/scripts/pompTest.R")

This will check whether you can work with pomp.

If it fails, try the following:

> source("https://kingaa.github.io/scripts/hello.R",echo=TRUE)

If this fails to give the “Hello!” message, you will need to follow the instructions below that correspond to your OS before re-trying the pompTest.R script.

Linux and unix

If you have trouble with any of the scripts above, make sure you have the GNU compiler collection (GCC), including gfortran, installed on your computer. Linux distributions typically include this by default but it is not impossible that you have somehow avoided this.

MacOSX

If the pompTest.R script fails because you cannot load pomp, try installing it from source. The easiest way to do this is to use the devtools package. Do

install.packages("devtools")
library(devtools)
install_github("kingaa/pomp")

If, while trying to install from source, you receive the error,

make: gfortran-8.2: No such file or directory

or one that otherwise refers to gfortran, then it is likely that you do not have the necessary version of gfortran installed. Have a look at these instructions and contact me at the address above if these don’t work for you.

Some users have reported receiving an error complaining that

'stdlib.h' file not found

This indicates that the command-line tools from Xcode have not been properly installed. In a unix terminal, run

xcode-select --install

to correct this problem.