R语言数据包自带数据集之mtcars数据集字段解释、数据导入实战

R语言数据包自带数据集之mtcars数据集字段解释、数据导入实战

目录

R语言数据包自带数据集之mtcars数据集字段解释、数据导入实战

#会用帮助?或者help函数

#字段说明

#导入包

#导入数据

Format

Note


#会用帮助?或者help函数

内置的mtcars数据框包含有关32辆汽车的信息,包括它们的重量,燃油效率(以每加仑英里为单位),速度等。

要了解有关数据集的更多信息,请使用help(mtcars)。

#字段说明

数据来自1974年美国汽车趋势杂志,包括32辆汽车(1973-74款)的油耗和10个方面的汽车设计和性能。

format

A data frame with 32 observations on 11 (numeric) variables.

[, 1]mpgMiles/(US) gallon :每加仑油能跑多少英里
[, 2]cylNumber of cylinders:气缸的个数
[, 3]dispDisplacement (cu.in.):车的排量
[, 4]hpGross horsepower:总马力
[, 5]dratRear axle ratio:后轴比
[, 6]wtWeight (1000 lbs):重量
[, 7]qsec1/4 mile time:衡量启动加速能力
[, 8]vsEngine (0 = V-shaped, 1 = straight):引擎类型
[, 9]amTransmission (0 = automatic, 1 = manual):传动方式,自动变速还是手动变速
[,10]gearNumber of forward gears:前进齿轮数
[,11]carbNumber of carburetors:化油器个数

#导入包

# 导入R内自带的ToothGrowth数据集
library(datasets)
data(mtcars)

#导入数据

str(mtcars)
head(mtcars)


Format

A data frame with 32 observations on 11 (numeric) variables.

[, 1]mpgMiles/(US) gallon
[, 2]cylNumber of cylinders
[, 3]dispDisplacement (cu.in.)
[, 4]hpGross horsepower
[, 5]dratRear axle ratio
[, 6]wtWeight (1000 lbs)
[, 7]qsec1/4 mile time
[, 8]vsEngine (0 = V-shaped, 1 = straight)
[, 9]amTransmission (0 = automatic, 1 = manual)
[,10]gearNumber of forward gears
[,11]carbNumber of carburetors

Note

Henderson and Velleman (1981) comment in a footnote to Table 1: ‘Hocking [original transcriber]'s noncrucial coding of the Mazda's rotary engine as a straight six-cylinder engine and the Porsche's flat engine as a V engine, as well as the inclusion of the diesel Mercedes 240D, have been retained to enable direct comparisons to be made with previous analyses.’


 

参考:R

参考:基础-R内置数据集

参考:[R语言]dataset数据包信息汇总

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Data+Science+Insight

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值