0
私はこのサンプルデータを持っています。ggplot2の同じグラフに2つのボックスプロットを追加するには
sample <- data.frame(sample = 1:12,
site = c('A','A','A','B','B','B','A','A','A','B','B','B'),
month = c(rep('Feb', 6), rep('Aug', 6)),
Ar = c(7,8,9,8,9,9,4,5,7,5,8,9))
そして、私はその総ので、同じグラフでそれらを結合する方法がある場合は、サイトAとサイトBは、各月ごとの右隣同士にしているだろう2箱ひげ図
ggplot(sample, aes(x=factor(month), y=Ar)) +
geom_boxplot(aes(fill=site))
ggplot(sample, aes(x=factor(month), y=Ar)) +
geom_boxplot()
を作成。
これは機能します!どうもありがとう! –