install.packages(tidyverse)
install.packages(haven)
10 Installing External Libraries
There may be times when you need to perform a specific task that is not available in the base R language.
This is where external libraries come in. External libraries are additional sets of functions and tools that extend the capabilities of R.
To install an external library (also called package) you simply need the command
install.packages(NAME of LIBRARY)
For instance, let’s install two central R
libraries: tidyverse
and haven
tidyverse
is an ecosystem of packages for data manipulation and visualization.haven
is a package in the tidyverse that provides R with the ability to read and write SPSS, Stata, and SAS files.
Once installed you need to load the library with
library(tidyverse)
library(haven)
You can also use R menu, which can be found at the top of the RStudio interface.
Tools > Install Packages