- Windows and (Mac) OS X: Go to https://CRAN.R-project.org/, the Comprehensive R Archive Network (CRAN). Simply click on the link for your operating system and at least install the “base” system.
For some tasks (e.g., output for some learning management systems) it is necessary that the base R
zip()function works. On Windows this requires to install the Rtools and to include them in the PATH environment variable.
Linux: While it is possible to download from CRAN by hand, it is easier for most distributions to install the packaged binary. For example, on Debian/Ubuntu:
apt-get install r-base-core r-base-dev
There is a wide variety of interfaces for using R including simply the shell, Emacs, or dedicated graphical user interfaces for Windows and OS X, respectively. Moreover, RStudio is an open-source cross-platform integrated development environment that facilitates many common tasks for R beginners.
- For R beginners: Go to https://www.RStudio.com/products/RStudio/ and obtain the “Desktop” version of RStudio (Open Source Edition).
2. R package “exams”
The core of R/exams is the open-source R package “exams”, also available from CRAN. It can be easily installed interactively from within R with a single command. If necessary, the development version of the package is also available, which may provide some new features or small improvements.
install.packages("exams", dependencies = TRUE)
install.packages("exams", repos = "https://R-Forge.R-project.org")
In some setups (e.g., on Mac OS or when using an older version of R) it may be necessary to add the argument
type = "source"to the command above.
Details: Several additional R packages, automatically installed by the command above, are needed for certain tasks:
base64enc (HTML-based output: Base64 encoding of supplements),
knitr (R/Markdown-based exercises),
magick (turning LaTeX output into images, e.g., for TikZ graphics),
png (NOPS exams: reading scanned PNG images),
RCurl (ARSnova: posting exercises),
RJSONIO (ARSnova: JSON format),
rmarkdown (pandoc-based conversion),
tinytex (PDF output: lightweight LaTeX distribution),
tth (HTML output from R/LaTeX exercises).
For producing PDF output, the typesetting system LaTeX is used internally by R/exams. If no LaTeX distribution (like TeXLive or MikTeX) is already installed, then TinyTeX is a lightweight distribution that can be easily obtained and maintained with the
tinytex R package (already installed in the step above). TinyTeX can be installed from within R with:
Note: When producing the first PDF files with R/exams,
tinytex will automatically install further required LaTeX packages and hence take somewhat longer to compile.
Instead of TinyTeX it is, of course, also possible to install a full LaTeX distribution, especially if this is not only needed for R/exams. See this LaTeX blog post for more details on the relative advantages.
- Windows: Go to http://www.MikTeX.org/ and click on “Download” to obtain the MikTeX distribution for Windows.
- (Mac) OS X and Linux: LaTeX distributions are available in the standard repositories and can be installed in the “usual” way, typically using the TeX Live distribution.
For certain conversions performed internally in R/exams, specifically when Markdown is involved, the universal document converter pandoc is employed. If you have installed RStudio, then pandoc is provided along with it and nothing else needs to be done.
Otherwise pandoc can be obtained from its web page (linked above) or standard repositories, e.g., for Debian/Ubuntu:
apt-get install pandoc
Optional: Further scanning tools
Note: Unless you want to process written NOPS exams from scanned PDF files, this section can be skipped.
If the scanned images of written NOPS exams (from your photocopier) are in PDF format, they need to be converted to PNG first using the PDF Toolkit
pdftk and ImageMagick’s
- Windows: Install PDFTk Free, ImageMagick, and Ghostscript.
- Note: During the installation of PDFTk and ImageMagick check the boxes for “Add application directory to your environmental path” or “Add application directory to your System Path”, respectively.
- MacOS: Install MacPorts, PDFTk Free, and ImageMagick.
- Note: ImageMagick requires MacPorts which in turn automatically installs Ghostscript as a dependency. The PDFTk version is for OS X 10.11 up to at least macOS 12 (Monterey).
Linux: Install PDFTk and ImageMagick from your distribution, e.g., for Debian/Ubuntu:
apt-get install pdftk imagemagick