I have asked a similar question where I could use stack=T
to solve my problem.
However, when I introduce another factor, stack=T
is not working.
Please see this example:
test <- data.frame(a=c(rep('x', 4),rep('y',4)),
b=c(2,-2,4,-3,5,-1,3,-5),
d=c('m','m','n','n','m','m','n','n'))
barchart(b~a, data=test, col=c("#00FFFF"), stack=TRUE,group=d)
but I want to get something like this:
barchart(b~a, data=test, col=c("#00FFFF"), stack=F,group=d)
and at the same time, align 0 in the same line.