ヒストグラムを作成するためにggplot2を使用しています:
geom_histogram(aes(x=...), y="..ncount../sum(..ncount..)")
エラーが発生します:
Mapping a variable to y and also using stat="bin".
With stat="bin", it will attempt to set the y value to the count of cases in each group.
This can result in unexpected behavior and will not be allowed in a future version of ggplot2.
If you want y to represent counts of cases, use stat="bin" and don't map a variable to y.
If you want y to represent values in the data, use stat="identity".
See ?geom_bar for examples. (Deprecated; last used in version 0.9.2)
一般的にこれを引き起こす原因は何ですか?変数をy
にマッピングしておらず、ヒストグラムを作成しているだけx
で、ヒストグラムバーの高さがデータの正規化された部分を表すようにしたいので、エラーについて混乱しています(すべてのバーの高さの合計が100%になるように)データ。)
編集geom_density
:の代わりに密度プロットを作成したい場合は、またはgeom_histogram
を使用します..ncount../sum(..ncount..)
か..scaled..
?何をするのかわかり..scaled..
ません。