Setting up R/mosaic

The software for this course is based on a technical computing platform called “R” and course-specific software that’s part of the mosaic series of packages. Depending on your or your instructor’s preference, you will access the platform in one way or another. The most common four ways are listed below, but your instructor may have provided another way.

  1. Use the “MOSAIC Calculus Sandbox” web app. Using the platform via the sandbox involves zero set-up. Just follow this link to the sandbox. The sandbox is the easiest way to get started, but can be slow.

  2. Use rstudio.cloud. Usually, your instructor asks you to set up your own account at <rstudio.cloud> and may give you a link to a “workspace” that has everything you need. This platform provides full features for using R, including document editing.

  3. Your instructor may give you an account on an institution-specific “RStudio server.”

  4. Install R and RStudio on your own laptop. There are many online videos showing how to do this installation.

If you use method (4) and in some cases (2) or (3), you need to do a bit more installation. First, install some software that provides background support for {mosaicCalc}. Do this by opening RStudio (or plain R if you are using that) and copy the following command into your R console. (Many of the online videos show what’s meant by a “console.”)

install.packages(c("remotes", "knitr", "ggplot2", "rmarkdown"))

Second, install {mosaicCalc} itself. In this process of this installation, you will be asked a question: “Do you want to install from sources …?” Answer no.

install.packages("mosaicCalc")

Installation is a one-time process, although if you switch to a new computer you will have to repeat the installation on that computer.

NOTE: Your instructor might ask you to update to the latest version of {mosaicCalc}. You can do this with the following command:

remotes::install_github("ProjectMOSAIC/mosaicCalc", build_vignettes = TRUE)

With {mosaicCalc} and its allies installed, you’re ready to start. Open R or RStudio to commence an R session. As your first command, type

library(mosaicCalc)

which tells R to use the {mosaicCalc} software.

You will need to give the library(mosaicCalc) command each time you open up R or RStudio. That might be once a day, once a week, depending on how often you close the R or RStudio app on your computer.