次のデータセットの場合、
Genre Amount
Comedy 10
Drama 30
Comedy 20
Action 20
Comedy 20
Drama 20
Genre
x軸がすべての金額の合計であり、y軸がすべての金額の合計であるggplot2折れ線グラフを作成したいと思います(条件付きGenre
)。
私は次のことを試しました:
p = ggplot(test, aes(factor(Genre), Gross)) + geom_point()
p = ggplot(test, aes(factor(Genre), Gross)) + geom_line()
p = ggplot(test, aes(factor(Genre), sum(Gross))) + geom_line()
しかし、役に立たない。