制作一个直方图,其频率是该行中的一个值 [英] Make a histogram who's frequency is a value in the row

查看:56
本文介绍了制作一个直方图,其频率是该行中的一个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何制作直方图,以使下面的每一行都用条形表示?例如,x轴"2012-10-02"和y轴"126","2012-10-03"和y轴"11352" ...等等.

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.

'date'变量是日期向量.

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

谢谢

推荐答案

这不是直方图.您已经按日期汇总了计数.

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")

这篇关于制作一个直方图,其频率是该行中的一个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆