I try to create a barplot, that uses besides and stacked at the same time. I have something that is similar to what I want with facet:
tmp <- morley
tmp$loc <- paste("No", tmp$Run %/% 2, sep="")
tmp$group <- as.logical(tmp$Run %% 2)
tmp$year <- tmp$Expt + 2000
tmp$value <- tmp$Speed
tmp <- subset(tmp, loc %in% c("No1", "No2", "No3"))
ggplot(tmp, aes(x=loc, y=value, fill=group)) +
geom_bar(stat ='identity', position ='stack') +
facet_grid (~year)
I would want that without facets and 2 legends (Green: No1, Red: No2, Blue: No3 and TRUE: 0% transparency, FALSE 40% transparency) with the years on the x-axis, the locations beside and the groups stacked. Also a legend with 6 entries No1 true, No1 false, No2 true... would be okay.
Is there a way to do this?