written by Junvie Pailden
This page contains the weekly laboratory materials.
R is an open source (free) software for statistical computing and graphics. More information on R in this page.
RStudio is a popular front-end (IDE) for R giving you a console, a scripting window, a graphics window, and an R workspace, among other options.
Weekly Materials
How to download R?
- On Windows, go to this page and click
Download R 3.4.1 for Windows
. - On Mac, go to this page and click
R-3.4.1.pkg
.
How to download Rstudio?
- On Windows and Mac, go to this page and click
Download
underRStudio Desktop Open Source License
.
Directions
-
Read the weekly lessons first and try out the R codes before answering the week’s exercise.
-
Download the week’s exercise file and open the file using RStudio. Right click the link and “Save as…” to your desktop folder (or any folder you keep all the lab materials). In some cases you might need to change the file extension to
.Rmd
. -
This RMarkdown
(.Rmd)
file type is used widely to share R codes and reproduce statistical results. More information is found on this page.-
Open the file
Week1-Exercise.Rmd
using RStudio. -
Write your R code inside the code chunks after each question.
# Code Chunks ```{r } ```
-
Write your short comments after the hashtag
#
sign. For longer comments, write it outside the work chunk. -
To generate the word document output, click the button
Knit
and wait for the word document to appear. -
RStudio will prompt you to install the
knitr
package.
-
-
Submit your completed laboratory exercise using Blackboard’s Turnitin feature. Your Turnitin upload link is found on your Blackboard course shell under the Laboratory folder.