Added require(ggplot2) to functions