0
0
R Programmingprogramming~5 mins

Package installation (install.packages) in R Programming - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Arequire()
Binstall.packages()
Clibrary()
Dload.package()
What argument do you pass to install.packages() to install the package 'ggplot2'?
A"ggplot2"
Bggplot2
Cinstall ggplot2
Dpackage = ggplot2
If you want to install a package from a specific CRAN mirror, which argument do you use?
Aurl
Bmirror
Crepos
Dsource
After installing a package, what function do you use to start using it in your R session?
Alibrary()
Binstall.packages()
Cload()
Duse()
What happens if you run install.packages() for a package that is already installed and up to date?
AIt causes an error
BIt uninstalls the package
CIt installs an older version
DNothing, it skips reinstalling
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.