Recall & Review
beginner
What is the purpose of the
install.packages() function in R?The
install.packages() function is used to download and install new packages from CRAN or other repositories so you can use additional functions in R.Click to reveal answer
beginner
How do you install the package named
dplyr in R?You run
install.packages("dplyr") in the R console. This downloads and installs the dplyr package.Click to reveal answer
intermediate
Can you use
install.packages() to update an already installed package?Yes, running
install.packages() again for a package will update it to the latest version if a newer one is available.Click to reveal answer
intermediate
What happens if you try to install a package that is already installed?
R will check the installed version and if it is the latest, it will not reinstall. Otherwise, it updates the package.
Click to reveal answer
beginner
Why do you need to install a package only once but load it every time you start R?
Installing downloads and sets up the package on your computer. Loading with
library() makes the package functions available in your current R session.Click to reveal answer
Which function do you use to install a package in R?
✗ Incorrect
The
install.packages() function downloads and installs packages. library() and require() load installed packages.What argument do you pass to
install.packages() to install the package 'ggplot2'?✗ Incorrect
You must pass the package name as a string, so use
"ggplot2".If you want to install a package from a specific CRAN mirror, which argument do you use?
✗ Incorrect
The
repos argument lets you specify the CRAN mirror URL.After installing a package, what function do you use to start using it in your R session?
✗ Incorrect
Use
library() to load the package into your current R session.What happens if you run
install.packages() for a package that is already installed and up to date?✗ Incorrect
R checks the version and skips reinstalling if the package is already up to date.
Explain the difference between installing a package and loading a package in R.
Think about what happens once versus what happens every time you start R.
You got /3 concepts.
Describe how you would install a package from a specific CRAN mirror.
Look for the argument that controls the source location.
You got /3 concepts.