06. 用R 自带的数据集

06. 用R 自带的数据集

无论是R 的base 包,还是像tidyverse 套件中的数据处理相关的R 包,都提供了很多数据集,便于我们的实战。

其实查看它们也很方便:

data() 就搞定了,其会返回一个列表,其中result 元素中包含了这些数据集信息的数据框:

> colnames(data()$results)[1] "Package" "LibPath" "Item" "Title" > table(data()$results[,"Package"])datasets 104

我们可以直接通过results 中的Item 中的内容使用它们:

> head(data()$results[,"Item"])[1] "AirPassengers" "BJsales" "BJsales.lead (BJsales)" "BOD" "CO2" [6] "ChickWeight" > head(CO2) Plant Type Treatment conc uptake1 Qn1 Quebec nonchilled 95 16.02 Qn1 Quebec nonchilled 175 30.43 Qn1 Quebec nonchilled 250 34.84 Qn1 Quebec nonchilled 350 37.25 Qn1 Quebec nonchilled 500 35.36 Qn1 Quebec nonchilled 675 39.2

相关推荐

手机相册在哪个文件夹
365bet官方投注网站

手机相册在哪个文件夹

06-29 👁️ 7389
科学上网:全面解析和使用 baacloud
bet·365官方网站

科学上网:全面解析和使用 baacloud

06-29 👁️ 1355
快乐家族
bt365体育在线备用

快乐家族

06-29 👁️ 6061
滞疐的解釋
bet·365官方网站

滞疐的解釋

06-29 👁️ 2550