To install a package in R, you can use the install.packages()
function followed by the name of the package you want to install. For example, to install the tidyverse
package:
main.r30 chars2 lines
Once the package is installed, you can load it into your R session using the library()
function:
main.r19 chars2 lines
If the package is not available in the default repository (CRAN), additional repositories can be added using the setRepositories()
function.
gistlibby LogSnag