Loading
Loading
Lesson 4 of 6
Use the RStudio Console to confirm that R responds, then install and load two essential packages.
Verification
Open RStudio and locate the Console. Enter the commands below. The exact version text will vary, but a version result and [1] 4 confirm that R is responding. These commands run on your computer; this lesson does not execute installation commands online.
Copyable code
R.version.string
2 + 2Expected result
[1] 4Copyable code
Run this when you need to report your R version, operating system, and attached packages.
sessionInfo()Packages
Packages extend R with additional tools. Install dplyr and ggplot2 once on each computer, or again when a package needs to be updated. Installation requires an internet connection.
Copyable code
install.packages(c("dplyr", "ggplot2"))Install once
Run install.packages() only once on each computer, or when a package needs to be updated.
Copyable code
library(dplyr)
library(ggplot2)Load each new session
Run library() at the beginning of a new R session when the script needs that package.