-5

I am currently working on creating histograms of personal tweets using Twitters API. I create a list of dates when a user has tweeted (in a for loop).

dates=c(dates,obtweets[[i]]$getCreated());

Example of dates:

> dates[1:3]
[1] "2012-09-09 16:01:18 EDT" "2012-09-29 17:26:12 EDT"
[3] "2012-09-28 17:53:34 EDT"

However, when I generate the hist(dates,breaks=7) it shows Density on the y-axis instead of frequency.

Any idea of how to show frequency instead of density?

user1710344
  • 91
  • 1
  • 1
  • 9
  • Please give a reproducible example so people can actually see your problem (see also http://stackoverflow.com/q/5963269). – rinni Oct 01 '12 at 14:34

1 Answers1

10

From the ?hist documentation:

freq: logical; if ‘TRUE’, the histogram graphic is a representation
      of frequencies, the ‘counts’ component of the result; if
      ‘FALSE’, probability densities, component ‘density’, are
      plotted (so that the histogram has a total area of one).
      Defaults to ‘TRUE’ _if and only if_ ‘breaks’ are equidistant
      (and ‘probability’ is not specified).

So you should try hist(dates, breaks = 7, freq = TRUE).

flodel
  • 87,577
  • 21
  • 185
  • 223