I have a data frame consisting of the columns; “name”, “time”, “count”. Showing how many items took a given length of time. I would like to be able to draw a histogram based on the counts (and have hist() pick the boundaries etc.)
+------+------+-------+ | name | time | count | +------+------+-------+ | foo | 5 | 5 | | foo | 10 | 8 | | foo | 15 | 6 | | foo | 20 | 8 | | bar | 5 | 7 | | bar | 10 | 4 | | bar | 15 | 9 | | bar | 20 | 10 | +------+------+-------+
From this I would like to be able to create histograms of times by name and times across the board. However, hist() counts up rows itself, I already have the counts in a count column. How can I achieve this?
The easiest is to use a barplot instead of a histogram.