(Updated: January 09 2024 19:31)

Please install the following:

  1. The current version of R: Even if you have used R previously, you should install the current version from the Comprehensive R Archive Network (CRAN).
    If you are asked to select a CRAN mirror, I suggest that you choose the 0-Cloud mirror which is first in the list.
    • Windows1 only: Download and install the latest version of Rtools.
    • Mac OS2 only:
      • Install the Apple Xcode developer tools. For macOS 10.7 (Lion) or higher, you can install Xcode for free from the App Store. For earlier versions of macOS, Xcode can be installed from your system DVD or downloaded from the Apple developer website.
      • Some R software (e.g., the rgl package for constructing dynamic 3D graphs) uses the the standard Unix X11 windowing system instead of the native Mac windowing system.
        1. Download the disk image (dmg) file for XQuartz (X11 softward for macOS) from the XQuartz website.
        2. When you open this file by double-clicking on it, you’ll find XQuartz.pkg; double-click on it to run the installer, clicking through all the defaults.
        3. Important: After the installer runs, you’ll have to log out and back on to your MacOS account – or simply reboot your Mac.
  2. RStudio: Install the free desktop version of RStudio.
  1. Create a RStudio project for MATH4939:
    • Start RStudio by clicking on the desktop icon.
    • From the RStudio menus, select File > New Project.
    • In the Create Project screen that appears, select New Directory.
    • In the Project Type screen, select New Project.
    • In the Create New Project screen, in the Directory name box, type MATH4939. Then click on the Create Project button at the lower right.
  2. Packages for this course: We will install many additional packages during the course. To get started, install basic packages by typing (or cutting and pasting) the following commands into the Console window in RStudio:
    install.packages(c("car", "devtools", "effects", "ggplot2", "Hmisc"))
    install.packages(c("knitr", "magrittr", "rgl", "rio", "rmarkdown", "readxl))
    install.packages("latticeExtra")
    install.packages("gplot")
    install.packages('cv')
    devtools::install_github('gmonette/spida2')
    devtools::install_github('gmonette/p3d')
    
  3. Check that things are working: Open this script and cut and paste it into a new R script in R Studio.
    • Run it manually line by line. Experiment with the code.
    • After running it line by line run it as a Rmarkdown file by hitting: Ctrl-Shift-K. This should show you the output of the script in an HTML window. If not, click on the new html file in your “Files” pane in RStudio.
  4. Post a message to Piazza: After connecting with Piazza, you can post a message to say whether you were successful. If you ran into problems post a message explaining what seems to have gone wrong and we will all try to help. Use the folder ‘assn1’ for this message.

  1. If you are using Windows and you are not sure whether you have a 64-bit or a 32-bit version you should first visit https://support.microsoft.com/en-us/help/15056/windows-7-32-64-bit-faq to find out.↩︎

  2. I thank John Fox for creating these detailed instructions for macOS.↩︎