bcss
home

Software required for BCSS workshops and tutorials

  Participants are asked to bring to the workshop a laptop computer with R and JAGS installed.

This page provides additional information on installing and updating the software required. Participants are required to download and install all software and check that it works before coming to the workshop.

You will need the following applications installed:

  • R statistical software, version 4.1.1 or later; see below.
     
  • JAGS application, version 4.3.0 or later; see below.
     
  • A spreadsheet application capable of handling CSV files (which I think all can).
     
  • A PDF reader which allows the file to be annotated, eg, with 'stickies'.

Your operating system

Windows (8 or later), Mac (El Capitan or later), or Ubuntu (Xenial or Bionic or Focal) all work. Other Linux distros should also work, but we have not tried. Our code has been most thoroughly tested on Windows machines.

Windows: Everything usually works fine out of the box on Windows 8 or later.

On recent versions of Windows, the path to the user’s Documents directory is typically C:/Users/<username>/Documents, the temporary directory is at C:/Users/<username>/AppData/Local/Temp, and the user's packages are in C:/Users/<username>/AppData/Local/R/win-library/x.y where x and y are the major and minor version numbers, eg, 4.2.

(Prior to R 4.2.0, packages were installed in C:/Users/<username>/Documents/R/win-library/x.y)

We have had issues with certain R functions where
   1. the user’s area was configured on a network drive, even though the actual location was on the local machine;
   2. the <username> included CJK (Chinese-Japanese-Korean) characters.

After installing R, you can check this by running

tempdir() ; .libPaths() ; Sys.getenv("R_USER")

If "\\\\" or "//" or non-Western characters or unicode hex values (eg, <U+611B>) appear in the output, some R functions will fail.

Please ensure that the set up is typical with all-ascii characters in the path; if necessary, please set up a new user account for use during the workshop. Alternatively, use the workaround described here.

Apple Mac OS X: The latest versions of R and JAGS are only available for 10.13 (High Sierra) or later. If you have an earlier version, please upgrade.

Old versions which run on 10.6 – 10.10 are still available for download, but they are not compatible with other packages we need to run.

Everything does work on Apple M1 processors, but currently (23 April 2022) some workarounds are needed, see below.

You will need the XQuartz utility; install this if necessary.

Ubuntu and other Linux distros: R 3.3.0 and above are no longer supported for Ubuntu 12.04 (Precise); only LTS versions are supported; see this blog post for information on installing R on Focal.

The versions of R and JAGS on the official repositories are not up to date, and may not even be cross-compatible. If you use Ubuntu, go here for a method to install R and JAGS and the rjags package, ensuring compatibility. For other distros, please check the installation instructions on the R and JAGS web sites (links below).

R statistical software

This is free, open-source software. It works across all platforms.

Version 4.2.0 was released on 22 April 2022. This is a feature update and likely has bugs! If you have R version 4.1.x already installed, do not update to 4.2 until 4.2.1 appears.

If you have a version prior to 4.1.1, please update. Uninstall the old version before installing the new version. (On Windows, you can have multiple versions installed, but you will run into compatibility issues if you start an old version by mistake.)

Downloads are available for Windows and Mac OS X El Capitan or later. For Ubuntu, see here for a quick way to install both R and JAGS. For other Linux distros, instructions are here.

A separate build of R for the Apple M1 processor is available, but no corresponding build of JAGS (the JAGS team are still experimenting; go here for latest information). The simplest option is to install the Intel (x86-64) version, R-4.1.3.pkg. This works fine on M1, though may be somewhat slower.

Mac users may get a slew of warnings when they open R, eg, Setting LC_CTYPE failed, using "C". These need to be fixed or packages will not load! See the help topic referenced in the warning message or go here.

Firewalls: For parallel processing, R uses sockets to communicate between processes running on different cores; this usually causes a firewall window to pop up the first time it is used. You need to "Allow access" for R to private networks.

JAGS

This is also free, open-source software which works across all platforms. If you have a version prior to 4.3.0, please uninstall and install the new version (currently 4.3.0).

All operating systems: look for the latest version download link just below the menu bar here. If that is not the version you want, use the links further down the page. Completely uninstall the old version of JAGS first.

Windows: You have a choice of versions: use 4.3.1 if you are using R 4.2.0 or later; use 4.3.0 for earlier versions of R. See here for explanations.

Mac: Downloads for Mac OS X (Mavericks or later) are here.

Linux: For Ubuntu, see here. For other Linux distros, go here and look at the Downloads section at the end; there's info on installing from source here.

JAGS does not appear in the Applications lists on Macs or Ubuntu. To check that it is installed properly and to see the version, open the Terminal and type "jags".

After installing R and JAGS, install the rjags package in R (see below) and check that you can load it without errors.

R packages

Installation of R packages (aka add-ins aka plug-ins) does not require administrator privileges. They are stored in the user's area (Windows default: C:/Users/<username>/Documents/R/win-library). The packages we need are available from CRAN and can be installed over the internet from within R.

The procedure is the same for all platforms.

rjags package: Open R and type (or copy-paste)

install.packages("rjags")

and press Enter/Return. A box may pop up asking about personal libraries: click Yes. You will need to select a mirror web site near you, or choose 0-cloud, which is a world-wide network.

If you get a message asking "Do you want to install from sources...", just click No or type "n" and press enter. (This arises when source code for a new version is uploaded to CRAN but the binaries have not yet been updated.)

On Windows, you will get an error if the version of JAGS does not correspond to the version of R: for R 4.2.0 or later, use JAGS 4.3.1; for earlier versions of R, use JAGS 4.3.0.

Check everything works! Open R and load rjags with

library(rjags)

You should get a message saying "Linked to JAGS 4.x.x".

If you get the error message error: Failed to locate any version of JAGS version 4 and you are sure you have successfully installed JAGS 4.3.0 or later, this could be due to a bug in rjags. See the workaround here.

Other R packages: Open R and copy/paste the following line into the Console:

install.packages(c("wiqid", "shiny", "secr", "beeswarm", "jagsUI"))

If you get a message asking "Do you want to install from sources...", just click No or type "n" and press enter.

Many other packages on which the above five depend will also be downloaded and installed, 18MB in all.

If you have problems installing R packages, don't worry: we can fix this at the beginning of the workshop.

Feedback

If you have suggestions, comments or questions about installing the software needed for the workshop please email workshops@bcss.org.my.

 

Page updated 12 May 2022 by Mike Meredith