-1
是否有可能在R中用條形圖在ggplot2中繪製條形圖,如下圖所示。我想比較預期值和實際值,我想生成一個與下圖類似的圖。我已經提供了一些僞代碼:條形圖中的條與ggplot2
library(tidyverse)
df = data_frame(name = letters[1:10],profit = rnorm(mean = 100, sd = 20, n = 10),
target = profit + rnorm(mean = 10, sd = 10, n = 10))
df %>% ggplot(aes(x = name, y = profit)) + geom_bar(stat = "identity")
https://stackoverflow.com/questions/42186060/overlay-two-酒吧地塊與 - GEOM吧 –