Installing R and JAGS on Apple Mac OS

HOME I don't have an Apple computer, but I have picked up some hints about installing R and JAGS on a Mac from trying to trouble-shoot friend's installations. 30 Oct 2017, changes in red.

People seem to run into problems with different versions of the Mac OS, R, JAGS and the rjags package. The only way to stay sane is to use recent versions of all four.

Check your Mac OS version!

From the Apple menu, choose About This Mac; the version number appears below the name. Note whether you have v. 10.11 (El Capitan) or later. If you have an earlier version, upgrade your OS before going further.


The latest version of R (R 3.4.2 as at 30 Nov 2017) is only available for OS X 10.11 (El Capitan) or later. Don't try to install it on older versions.

If you have OS X 10.6 - 10.10, you can still install an old version of R, but be prepared to sort out the tangle of compatibility issues which result.

Installers for new and old OS's are here; be sure to select the right one for your machine.

When you open R, you may get a slew of warnings:

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C"
2: Setting LC_COLLATE failed, using "C"
WARNING: You're using a non-UTF8 locale, therefore only ASCII characters will work.
Please read R for Mac OS X FAQ (see Help) section 9 and adjust your system preferences accordingly.

This needs to be fixed, or R will have problems reading the package code. For instructions on how to fix it, look at Section 7 (not section 9) of the help file suggested in the message or go to Stackoverflow.


The latest version of JAGS (JAGS 4.3.0) requires OS X 10.9 or later. Do not try to install it on older versions. Do look at the installation instructions too. If you have an old version of JAGS and you want to upgrade to the latest, it's best to completely uninstall the old version first; old files that aren't overwritten by the new version can still cause problems.

The older version of JAGS (JAGS 3.4.0) is still available, but only use that if you want a complicated life.

JAGS does not appear in Applications. To check that it's installed properly, open the Terminal and type "jags". You should get a message telling you which version is installed. Type "exit" to close JAGS. If you tried to install JAGS 4 on an old OS X, you will get an error message.

The rjags package

You need rjags to access JAGS from R. The R2jags and jagsUI packages depend on rjags, so you will get similar messages if you try to install R2jags or jagsUI.

If you have recent versions of your OS and R, and JAGS version 4.2.0 or later, it's easy: install rjags within R by running install.packages("rjags").

If you have old versions, you will have to tinker. To begin with, JAGS 3 requires rjags 3-15. You can get the source code from the CRAN archive and install from source. The rjags source includes C code, so you may need to install the XCode tools. You should install the coda package that rjags depends on before installing rjags from source.

Updated 30 October 2017 by Mike Meredith