Make a histogram who's frequency is a value in the row

跟風遠走 提交于 2019-12-25 15:42:10

问题


How can I make a histogram so that each row below is represented by a bar? Eg, x axis "2012-10-02" and y axis "126", "2012-10-03" and y axis "11352"... and so on.

The 'date' variable is a Date vector.

         date steps
1  2012-10-02   126
2  2012-10-03 11352
3  2012-10-04 12116
4  2012-10-05 13294
5  2012-10-06 15420
6  2012-10-07 11015
7  2012-10-09 12811
8  2012-10-10  9900
9  2012-10-11 10304
10 2012-10-12 17382

Thank you


回答1:


This is not a histogram. You've already aggregated the counts by date.

barplot(df$steps, names = df$date,
        xlab = "Date", ylab = "Steps",
        main = "Your title here")



来源:https://stackoverflow.com/questions/31408506/make-a-histogram-whos-frequency-is-a-value-in-the-row

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!