R language built-in data set

help(package='datasets')

View dataset help
Insert picture description here

data()

Access to the data set The
Insert picture description here
first is the name of the data set, and the content of the data set is introduced later, including all the data types used in R (vectors, matrices, lists, factors, data frames, time series, etc.).
The data can be output by directly inputting the name of the data set: the names of
Insert picture description here
these data sets are built-in, and it is generally best to avoid duplication when naming variables, otherwise the data set will be replaced.

help("mtcars")

View the information of a specific data set
Insert picture description here
List the data sets in the R expansion pack to load the expansion pack

data(package="MASS")

Display all available data sets in R

data(package=.packages(all.available = TRUE))

If you do not want to load the R package but want to load the data set in it, directly use the data function to load the data set
eg

data(Chile,package="car")
Chile

Insert picture description here

Guess you like

Origin blog.csdn.net/m0_46445293/article/details/104927849