다음 예제에서 그래프를 스택하는 방법은 무엇입니까?geom_area 플롯에 누적 된 커브
a<-as.POSIXlt("2013-07-01 00:00:00",origin = "1960-01-01",tz="GMT")
b<-as.POSIXlt("2013-07-08 00:00:00",origin = "1960-01-01",tz="GMT")
woche1<-sample(seq(as.numeric(a),by=60*60,length.out=200),200,T)
woche2<-sample(seq(as.numeric(b),by=60*60,length.out=200),200,T)
times<-c(woche1,woche2)
class(times)<-c("POSIXt","POSIXct")
times<-as.POSIXlt(times,origin = "1960-01-01",tz="GMT")
key<-sample(LETTERS[1:3],200,T)
df<-data.frame(times=times,order=factor(rep(1:2,each=100)), key=key)
p<-ggplot(df, aes(x=times))
p<-p + geom_area(aes(y = ..count.., fill = key, group = key),stat = "bin",position = 'stack')#,position = 'stack'
p<-p + facet_wrap(~ order,scales="free_x")
p
당신이 질문을 좀 명확 할 경우, 당신은 아마 더 빨리/더 나은 도움/더 얻을 수 있습니다. –
... 구체적으로 말하자면, "스택"이 의미하는 바를 정확히 확장해야 할 필요가 있다고 생각합니다. – joran
http://stackoverflow.com/questions/2363881/ggplot2-geom-area-overlapping-instead-of-stacking과 같은 문제가 있습니다. 다른 해결책이 있습니까? – Klaus