Concepts

This is accomplished with the position = “fill” part of the geom_bar. Line 4: Switches the orientation from vertical to horizontal. In case you are interested, the new version of ggplot, which was just released, now accomplishes this with orientation = y. ................
................