R/legend_geom.R

# #' E&R legend - specific size, alpha manipulation 
# #' 
# #' @param size - size of points, lines. Default value for points: 8, default value for lines: 1.2.
# #' @param alpha - opacity of points, lines. Default value: 1.
# #' @param nrow - number of rows in which categories should show up.
# #' @examples 
# #' \dontrun{
# #' ggplot(mtcars, aes(qsec, mpg, color = factor(cyl))) +
# #'     geom_point() +
# #'     theme_enr() + 
# #'     legend_enr() +
# #'     legend_point()
# #'      }
# 
# legend_point <- function(size = 8, alpha = 1, nrow = NULL) {
#   guides(color = guide_legend(nrow = nrow, override.aes = list(size = size, linetype = 0, alpha = alpha)))
# }
# 
# legend_line <- function(size = 1.2, alpha = 1, nrow = NULL) {
#   guides(color = guide_legend(nrow = nrow, override.aes = list(size = size, alpha = alpha)))
# }
# 
# legend_density <- function(nrow = NULL) {
#   guides(fill = guide_legend(nrow = nrow, override.aes = list(color = 'white')))
# }
# 
AMUFacultyOfEnglish/ENRanalytics documentation built on May 5, 2019, 11:36 a.m.