(Updated: January 09 2024 19:31)
Please install the following:
- 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.
- Windows only: Download and install the
latest version of Rtools.
- Mac OS 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.
- Download the disk image (dmg) file for XQuartz (X11 softward for
macOS) from the XQuartz website.
- 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.
- Important: After the installer runs, you’ll have to log out and back
on to your MacOS account – or simply reboot your Mac.
- RStudio: Install the free desktop version of RStudio.
- Scroll towards the bottom of the page and right-click on the
appropriate installer for your operating system. Download it and then
run the downloaded file. When you first run RStudio, it will use the
last version of R that you installed.
- 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.
- 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')
- 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.
- 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.