0
사용을 막대 그래프에서 장난감 데이터 집합을 피하고 다음R : ggplot2 - 스태킹 및 <code>ggplot2</code> 패키지를 사용하여면 간단한 막대 그래프 생성
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()
또는 그 밖의 다른 곳에서 적용되지 않는 이유는 무엇입니까?