0
ggplot2
パッケージを使用してファセットを有するシンプルな棒グラフを作成するおもちゃのデータセットを使用します。R:ggplot2 - バーグラフに重ねて逃れ
library(ggplot2)
library(reshape2) # to convert to long format
databas<-read.csv(data=
"continent,apples,bananas
North America,30,20
South America,15,34.5
Europe,15,19
Africa,5,35")
databaslong<-melt(databas)
# plotting as colored bars
ggplot(databaslong, aes(x=variable, y=value, fill=variable))+
geom_col()+
facet_grid(.~continent)
をし、次を得る:
リンゴをバナナの上に置く方法(またはその逆)なぜディレクティブposition="stack"
(またはposition="dodge"
)はgeom_col()
または他の場所で、ここでは効果がないのでしょうか?