In this lab, you will write some simple R Markdown to ensure that you can compile R Markdown documents into PDF files. Assignments in this course will be submitted in the form of compiled PDF documents so it is important that you have the tools installed to do this.
Install R Packages
R packages can be installed with the install.packages() function.
If you haven’t already, install the tidyverse package using the install.packages() function.
You will also need to install the rmarkdown package in order to knit R Markdown files into HTML or PDF files.
NOTE: DO NOT put the install.packages() code in this document. You should only ever call install.packages() in the console in RStudio.
Question 1
The code chunk below loads the tidyverse package with the library() function.
## This is a comment. It does not get executed by R.library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.6
✔ forcats 1.0.1 ✔ stringr 1.6.0
✔ ggplot2 4.0.1 ✔ tibble 3.3.1
✔ lubridate 1.9.4 ✔ tidyr 1.3.2
✔ purrr 1.2.1
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Using the same format as above, write a code chunk that loads the datasets package.
library(datasets)
Question 2
You can obtain the version of R that you are using with the following code.
print(R.version.string)
[1] "R version 4.5.2 (2025-10-31)"
You can find the version of RStudio from the “About RStudio” menu option.
Using an unordered list (i.e. bulleted list), write the version of R that you are using and the version of RStudio that you are using.
R version: 4.5.2 (2025-10-31)
RStudio version: 2026.01.0+392 (2026.01.0+392)
Write the same information in the bullets above using an ordered / numbered list below.