-5

現在、Twitter API を使用して個人のツイートのヒストグラムを作成する作業を行っています。ユーザーが (for ループで) ツイートした日付のリストを作成します。

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

日付の例:

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

ただし、hist(dates,breaks=7) を生成すると、頻度ではなく密度が y 軸に表示されます。

密度の代わりに周波数を表示する方法はありますか?

4

1 に答える 1

10

?histドキュメントから:

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

だからあなたは試してみるべきhist(dates, breaks = 7, freq = TRUE)です。

于 2012-09-30T20:55:14.977 に答える