1.hist() 直方图
V
= read.csv
("data//test1.csv")
hist
(V
$x1
,col
= 1:7)
hist
(V
$x2
,)
2.plot()散点图 R中最强大的绘图函数
plot
(V
$x1
,V
$x2
)
3.table()列联表函数
library
(openxlsx
)
d2.
1 = read.xlsx
("data/mvstats5.xlsx","d2.1")
attach
(d2.
1)
table
(年龄
)
4.barplot()条形图、pie()饼图
barplot
(table
(年龄
),col
= 1:7)
pie
(table
((年龄
)),col
= 1:7)
table
(年龄
,性别
)
barplot
(table
(年龄
,性别
),beside
= T
,col
= 1:2)
barplot
(table
(性别
,年龄
),beside
= T
,col
= 1:2)
ftable
(性别
,年龄
,结果
)
转载请注明原文地址:https://blackberry.8miu.com/read-43507.html