Welcome

In the course we are going to use R with some of its packages. Also, we will use Stan (and possibly JAGS) for MCMC. Before arriving at the first day of the course, make sure you have installed RStudio and a version of R greater than or equal to \(4.2\). R can be downloaded from cran

You also need to install an interface to Stan. You can follow instructions here.

It is also recommended that you install JAGS. You can download it from here

R Packages

After you have installed CmdStanR and JAGS, you have to copy and paste this script into R to install some packages that we are going to use during the course

get.packages <- function () 
{
    pkglist = c("knitr", 
                "formatR", 
                "jagsUI",
                "coda",
                "brms",
                "circular",
                "bbmle",
                "emdbook",
                "momentuHMM",
                "geosphere",
                "mitools",
                "loo",
                "ggplot2",
                "ggpubr",
                "dplyr")
    inst.pkgs = rownames(installed.packages())
    newpkgs <- pkglist[!pkglist %in% inst.pkgs]
    if (length(newpkgs) > 0) {
        do.call("install.packages", list(pkglist))
    }
}

get.packages()

Before the course:

We recommend that before starting the course, you take a look at the brief introduction to R that we prepared here. While we hope many of you are already R users, perhaps you haven’t seen how to set up loops or write functions yet.


Juan Manuel Morales 2024-01-16