I have the following graph
test <- expand.grid('cat' = LETTERS[1:5], 'cond'= c(F,T), 'year' = 2001:2005)
test$value <- floor((rnorm(nrow(test)))*100)
test$value[test$value < 0] <- 0
ggplot() +
geom_bar(data=test, aes(y = value, x = year, fill = cat), stat="identity",position='dodge') +
theme_bw()
and I need to divide each 'cat' by 'cond'(true or false). How do I do that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…