0
我正在試圖製作兩個數據集的一個圖來比較它們的值。將兩個圖組合成一個
ggplot()
ggplot(pos_plot, aes(x=WORD, y=FREQ)) +
geom_bar(position="dodge", colour="blue", stat = "identity") +
ggplot(neg_plot, aes(x=WORD, y=FREQ)) +
geom_bar(position="dodge", colour="red", stat = "identity")
但是當我運行這段代碼我得到的錯誤:
Error: Don't know how to add o to a plot
有誰知道我做錯了嗎?
這將是更容易,如果你合併做兩個數據集合爲一個並創建一個識別源數據集的因子。然後你可以使用'facet.grid'來形成一個diptych,或者使用'fill = [factor id'source']來將它們在一個繪圖中進行比較。 – ulfelder
你想如何結合這兩個地塊?兩個並排的情節,或一個情節與並排的酒吧? –