No need to install/load any package. datasets
are
already pre-installed.
?datasets()
library(help = "datasets")
?swiss # give information on data set 'swiss'
help(USArrests) # give information on data set 'USArrests'
You will find some code that can be used to create graphs in the help files.
require(stats); require(graphics)
pairs(swiss, panel = panel.smooth, main = "swiss data",
col = 3 + (swiss$Catholic > 50))
Some datasets in utils
package.
require(utils)
?data
data() # list all available data sets
See datasets here.
# install.packages("AER")
library(AER)
## Loading required package: car
## Loading required package: carData
## Loading required package: lmtest
## Loading required package: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
## Loading required package: sandwich
## Loading required package: survival
??AER
data("Guns")
## visualization
library("lattice")
xyplot(log(violent) ~ as.numeric(as.character(year)) | state, data = Guns, type = "l")