Here is my script (example inspired from here and using the reorder option from here):
reorder
library(ggplot2) Animals <- read.table( header=TRUE, tex
Along the same lines as the answer from user Alex, a less manual way of adding the categories might be
d <- with(Animals, expand.grid(unique(Category), unique(Reason))) names(d) <- names(Animals)[1:2] Animals <- merge(d, Animals, all.x=TRUE) Animals$Species[is.na(Animals$Species)] <- 0