Back
Close

Computing with Data

elgeish
578K views

Installing Packages

R features easy installation of both core R and third party packages:

# install package ggplot2
install.packages("ggplot2")
# install package from a particular mirror site
install.packages("ggplot2", repos = "http://cran.r-project.org")
# install a package from source, rather than binary
install.packages("ggplot2", type = "source")
library(ggplot2)  # bring package into scope
# display all datasets in the package ggplot2
data(package = "ggplot2")
installed.packages()  # display a list of installed packages
update.packages()  # update currently installed packages
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io