1.用qplot(x,data=data,geom.=”bar”,weight=y)+scale_y_continuous("y")畫出y關於x的條形。
圖中提示binwidth這里是指矩形的寬度,指定之后如下
qplot(x,data=data,geom="bar",weight=y,binwidth=0.2)+scale_y_continuous("y")
2.用qplot(x,data=data,geom.=”bar”)畫出來的是頻率直方圖,反映的是單維變量
做個小推廣:程序員經常久坐,頸椎毛病比較多,特別推薦ventry頸椎保健枕