barplot(apply(data,1,mean))kk
利用barplot做按行做均值条形图,发现有的省份不显示
利用las=3,使各省份名称用列显示来优化,结果名称完整。
北京,上海,广东经济水平较高
barplot(apply(data,1,mean),las=3)#按行做均值条形图d3.1,2按列做均值图条形图。数据显示,食品的经济占比最高
barplot(apply(data,2,mean))按列做彩色均值图条形图,使得数据显示更加明显
barplot(apply(data,2,mean),col=1:8)在去掉食品的情况下,发现交通教育占比较高
barplot(apply(data[,2:8],2,mean))利用stars做具有图例的180度彩色圆形星相图。根据图例可知,北京,上海,广东经济水平较高。
stars(data,full=F,draw.segments=T,key.loc=c(17,7))library(aplpack) #加载aplpack包
aplpack::faces(data)effect of variables:
modified item Var
"height of face " "食品"
"width of face " "衣着"
"structure of face" "设备"
"height of mouth " "医疗"
"width of mouth " "交通"
"smiling " "教育"
"height of eyes " "居住"
"width of eyes " "杂项"
"height of hair " "食品"
"width of hair " "衣着"
"style of hair " "设备"
"height of nose " "医疗"
"width of nose " "交通"
"width of ear " "教育"
"height of ear " "居住"