diff --git a/DESCRIPTION b/DESCRIPTION index bc0a84e..52c2dc7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,7 +4,10 @@ Version: 0.0.2 Authors@R: person("Antonio", "Páez", , "paezha@mcmaster.ca", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-6912-9919")) -Description: Palettes Inspired by Works of Mexican Muralists. +Description: Color palettes inspired by the works of + Mexican painters and muralists. The package includes functions that + return vectors of colors and also functions to use color and fill + scales in 'ggplot2' visualizations. License: MIT + file LICENSE Encoding: UTF-8 Roxygen: list(markdown = TRUE) diff --git a/R/MexBrewer-package.R b/R/MexBrewer-package.R index 475a91a..c087df0 100644 --- a/R/MexBrewer-package.R +++ b/R/MexBrewer-package.R @@ -19,6 +19,7 @@ NULL #' #' @docType data #' @keywords datasets +#' @return A simple features data frame #' @name mx_estados #' @usage data(mx_estados) #' @examples @@ -47,8 +48,8 @@ NULL #' @name df_mxstate_2020 #' @docType data #' @references Population estimates taken from the \href{https://www.inegi.org.mx/programas/ccpv/2020/default.html#Tabulados}{Censo 2020.} -#' #' @keywords data +#' @return A data.frame #' @examples #' data("df_mxstate_2020") #' head(df_mxstate_2020) @@ -138,7 +139,7 @@ MexPalettes <- list( #' @param override.order Colors are picked from palette to maximize readability and aesthetics. This means #' that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, #' colors are selected in sequential order from the full palette instead. Default is FALSE. -#' @return A vector of colors. +#' @return A vector of colors for use in visualization tasks #' @examples #' mex.brewer("Atentado") #' @@ -229,7 +230,6 @@ print.palette <- function(x, ...) { #' @export sequential_palettes <- c("Aurora", "Concha", "Frida", "Naturaleza", "Taurus1", "Taurus2", "Tierra") - # Names whether a palette is sequential #' Sequential Palette Check @@ -239,9 +239,9 @@ sequential_palettes <- c("Aurora", "Concha", "Frida", "Naturaleza", "Taurus1", " #' @param palette_name Name of Palette. Choices are: #' \code{Alacena},\code{Atentado}, \code{Aurora}, \code{Casita1}, \code{Casita2}, \code{Casita3}, \code{Concha}, \code{Frida}, \code{Huida}, \code{Maiz}, \code{Naturaleza},\code{Ofrenda}, #' \code{Revolucion}, \code{Ronda}, \code{Taurus1}, \code{Taurus2},\code{Tierra}, \code{Vendedora}. +#' @return TRUE/FALSE if palette is sequential #' @examples #' sequential.palette("Aurora") -#' @return TRUE/FALSE if palette is sequential #' @export sequential.palette <- function(palette_name){ @@ -258,10 +258,57 @@ sequential.palette <- function(palette_name){ # MexBrewer palettes for plotting with ggplot2 -#' MexBrewer palettes for plotting with ggplot2 + +#' Continuous MexBrewer scales for use with ggplot2 #' -#' Function for using \code{MexBrewer} colors schemes in \code{ggplot2}. Use \code{\link{scale_color_mex_d}} and \code{\link{scale_fill_mex_d}} -#' for discrete scales and \code{\link{scale_color_mex_c}} and \code{\link{scale_fill_mex_c}} for continuous scales. +#' Functions \code{\link{scale_color_mex_c}} and \code{\link{scale_fill_mex_c}} for continuous scales enable the use of \code{MexBrewer} colors with \code{ggplot2} continuous scales. +#' +#' @param palette_name Name of Palette. Choices are: +#' \code{Alacena}, \code{Atentado}, \code{Aurora}, \code{Casita1}, \code{Casita2}, \code{Casita3}, \code{Concha}, \code{Frida}, \code{Huida}, \code{Maiz}, \code{Naturaleza},\code{Ofrenda}, +#' \code{Revolucion}, \code{Ronda}, \code{Taurus1}, \code{Taurus2},\code{Tierra}, \code{Vendedora}. +#' @param direction Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed +#' @param ... Other arguments passed on to \code{\link[ggplot2]{scale_color_gradientn}} +#' @name ggplot2-scales-continuous +#' @rdname ggplot2-scales-continuous +#' @return A `ScaleContinuous` object that can be added to a `ggplot` object +#' @family color scales +#' @import ggplot2 +#' @export +scale_color_mex_c <- function(palette_name, direction=1, ...){ + + `%notin%` <- Negate(`%in%`) + + if (direction %notin% c(1, -1)){ + stop("Direction not valid. Please use 1 for standard palette or -1 for reversed palette.") + } + + scale_color_gradientn(colors = mex.brewer(palette_name = palette_name, direction = direction, override.order = F), + ...) +} + +#' @rdname ggplot2-scales-continuous +#' @export +#' +scale_colour_mex_c <- scale_color_mex_c + +#' @rdname ggplot2-scales-continuous +#' @export +#' +scale_fill_mex_c <- function(palette_name, direction=1, ...){ + + `%notin%` <- Negate(`%in%`) + + if (direction %notin% c(1, -1)){ + stop("Direction not valid. Please use 1 for standard palette or -1 for reversed palette.") + } + + scale_fill_gradientn(colors = mex.brewer(palette_name = palette_name, direction = direction, override.order = F), + ...) +} + +#' Discrete MexBrewer scales for use with ggplot2 +#' +#' Functions \code{\link{scale_color_mex_d}} and \code{\link{scale_fill_mex_d}} enable the use of \code{MexBrewer} colors with \code{ggplot2} discrete scales. #' #' @param palette_name Name of Palette. Choices are: #' \code{Alacena}, \code{Atentado}, \code{Aurora}, \code{Casita1}, \code{Casita2}, \code{Casita3}, \code{Concha}, \code{Frida}, \code{Huida}, \code{Maiz}, \code{Naturaleza},\code{Ofrenda}, @@ -271,12 +318,16 @@ sequential.palette <- function(palette_name){ #' that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, #' colors are selected in sequential order from the full palette instead. Default is FALSE. #' @param ... Other arguments passed on to \code{\link[ggplot2]{discrete_scale}} +#' @family color scales +#' @name ggplot2-scales-discrete +#' @rdname ggplot2-scales-discrete +#' @return A `ScaleDiscrete` object that can be added to a `ggplot` object #' @import ggplot2 #' @examples #' library(ggplot2) -#' ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + -#' geom_point() + -#' scale_color_mex_d("Atentado") +#' ggplot(data=iris, aes(x=Species, y=Sepal.Length, fill=Species)) + +#' geom_violin() + +#' scale_fill_mex_d("Aurora") #' @export scale_color_mex_d <- function(palette_name, direction=1, override.order=FALSE, ...){ mex.brewer.disc <- function(palette_name, direction = c(1, -1), override.order=FALSE) { @@ -308,25 +359,11 @@ scale_color_mex_d <- function(palette_name, direction=1, override.order=FALSE, . ...) } -#' MexBrewer palettes for plotting with ggplot2 -#' -#' Function for using \code{MexBrewer} colors schemes in \code{ggplot2}. Use \code{\link{scale_color_mex_d}} and \code{\link{scale_fill_mex_d}} -#' for discrete scales and \code{\link{scale_color_mex_c}} and \code{\link{scale_fill_mex_c}} for continuous scales. -#' -#' @param palette_name Name of Palette. Choices are: -#' \code{Alacena}, \code{Atentado}, \code{Aurora}, \code{Casita1}, \code{Casita2}, \code{Casita3}, \code{Concha}, \code{Frida}, \code{Huida}, \code{Maiz}, \code{Naturaleza},\code{Ofrenda}, -#' \code{Revolucion}, \code{Ronda}, \code{Taurus1}, \code{Taurus2},\code{Tierra}, \code{Vendedora}. -#' @param direction Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed -#' @param override.order Colors are picked from palette to maximize readability and aesthetics. This means -#' that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, -#' colors are selected in sequential order from the full palette instead. Default is FALSE. -#' @param ... Other arguments passed on to \code{\link[ggplot2]{discrete_scale}} -#' @import ggplot2 -#' @examples -#' library(ggplot2) -#' ggplot(data=iris, aes(x=Species, y=Sepal.Length, fill=Species)) + -#' geom_violin() + -#' scale_fill_mex_d("Aurora") +#' @rdname ggplot2-scales-discrete +#' @export +scale_colour_mex_d <- scale_color_mex_d + +#' @rdname ggplot2-scales-discrete #' @export scale_fill_mex_d <- function(palette_name, direction = 1, override.order=FALSE, ...){ mex.brewer.disc <- function(palette_name, direction = c(1, -1), override.order=FALSE) { @@ -357,104 +394,4 @@ scale_fill_mex_d <- function(palette_name, direction = 1, override.order=FALSE, ...) } - -#' MexBrewer palettes for plotting with ggplot2 -#' -#' Function for using \code{MexBrewer} colors schemes in \code{ggplot2}. Use \code{\link{scale_color_mex_d}} and \code{\link{scale_fill_mex_d}} -#' for discrete scales and \code{\link{scale_color_mex_c}} and \code{\link{scale_fill_mex_c}} for continuous scales. -#' -#' @param palette_name Name of Palette. Choices are: -#' \code{Alacena}, \code{Atentado}, \code{Aurora}, \code{Casita1}, \code{Casita2}, \code{Casita3}, \code{Concha}, \code{Frida}, \code{Huida}, \code{Maiz}, \code{Naturaleza},\code{Ofrenda}, -#' \code{Revolucion}, \code{Ronda}, \code{Taurus1}, \code{Taurus2},\code{Tierra}, \code{Vendedora}. -#' @param direction Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed -#' @param ... Other arguments passed on to \code{\link[ggplot2]{scale_color_gradientn}} -#' @import ggplot2 -#' @examples -#' library(ggplot2) -#' ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Sepal.Length)) + -#' geom_point() + -#' scale_color_mex_c("Tierra", direction=-1) -#' @export -scale_color_mex_c <- function(palette_name, direction=1, ...){ - - `%notin%` <- Negate(`%in%`) - - if (direction %notin% c(1, -1)){ - stop("Direction not valid. Please use 1 for standard palette or -1 for reversed palette.") - } - - scale_color_gradientn(colors = mex.brewer(palette_name = palette_name, direction = direction, override.order = F), - ...) -} - - -#' MexBrewer palettes for plotting with ggplot2 -#' -#' Function for using \code{MexBrewer} colors schemes in \code{ggplot2}. Use \code{\link{scale_color_mex_d}} and \code{\link{scale_fill_mex_d}} -#' for discrete scales and \code{\link{scale_color_mex_c}} and \code{\link{scale_fill_mex_c}} for continuous scales. -#' -#' @param palette_name Name of Palette. Choices are: -#' \code{Alacena}, \code{Atentado}, \code{Aurora}, \code{Casita1}, \code{Casita2}, \code{Casita3}, \code{Concha}, \code{Frida}, \code{Huida}, \code{Maiz}, \code{Naturaleza},\code{Ofrenda}, -#' \code{Revolucion}, \code{Ronda}, \code{Taurus1}, \code{Taurus2},\code{Tierra}, \code{Vendedora}. -#' @param direction Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed -#' @param ... Other arguments passed on to \code{\link[ggplot2]{scale_color_gradientn}} -#' @import ggplot2 -#' @export -scale_fill_mex_c <- function(palette_name, direction=1, ...){ - - `%notin%` <- Negate(`%in%`) - - if (direction %notin% c(1, -1)){ - stop("Direction not valid. Please use 1 for standard palette or -1 for reversed palette.") - } - - scale_fill_gradientn(colors = mex.brewer(palette_name = palette_name, direction = direction, override.order = F), - ...) -} - - -#' MexBrewer palettes for plotting with ggplot2 -#' -#' Function for using \code{MexBrewer} colors schemes in \code{ggplot2}. Use \code{\link{scale_color_mex_d}} and \code{\link{scale_fill_mex_d}} -#' for discrete scales and \code{\link{scale_color_mex_c}} and \code{\link{scale_fill_mex_c}} for continuous scales. -#' -#' @param palette_name Name of Palette. Choices are: -#' \code{Alacena}, \code{Atentado}, \code{Aurora}, \code{Casita1}, \code{Casita2}, \code{Casita3}, \code{Concha}, \code{Frida}, \code{Huida}, \code{Maiz}, \code{Naturaleza},\code{Ofrenda}, -#' \code{Revolucion}, \code{Ronda}, \code{Taurus1}, \code{Taurus2},\code{Tierra}, \code{Vendedora}. -#' @param direction Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed -#' @param override.order Colors are picked from palette to maximize readability and aesthetics. This means -#' that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, -#' colors are selected in sequential order from the full palette instead. Default is FALSE. -#' @param ... Other arguments passed on to \code{\link[ggplot2]{discrete_scale}} -#' @import ggplot2 -#' @examples -#' library(ggplot2) -#' ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + -#' geom_point() + -#' scale_colour_mex_d("Frida") -#' @export - -scale_colour_mex_d <- scale_color_mex_d - -#' MexBrewer palettes for plotting with ggplot2 -#' -#' Function for using \code{MexBrewer} colors schemes in \code{ggplot2}. Use \code{\link{scale_color_mex_d}} and \code{\link{scale_fill_mex_d}} -#' for discrete scales and \code{\link{scale_color_mex_c}} and \code{\link{scale_fill_mex_c}} for continuous scales. -#' -#' @param palette_name Name of Palette. Choices are: -#' \code{Alacena}, \code{Atentado}, \code{Aurora}, \code{Casita1}, \code{Casita2}, \code{Casita3}, \code{Concha}, \code{Frida}, \code{Huida}, \code{Maiz}, \code{Naturaleza},\code{Ofrenda}, -#' \code{Revolucion}, \code{Ronda}, \code{Taurus1}, \code{Taurus2},\code{Tierra}, \code{Vendedora}. -#' @param direction Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed -#' @param ... Other arguments passed on to \code{\link[ggplot2]{scale_color_gradientn}} -#' @import ggplot2 -#' @examples -#' library(ggplot2) -#' ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Sepal.Length)) + -#' geom_point() + -#' scale_colour_mex_c("Concha", direction=-1) -#' @export - -scale_colour_mex_c <- scale_color_mex_c - - # TO-DO FUNCTION TO DISPLAY ALL PALETTES diff --git a/man/MexBrewer-package.Rd b/man/MexBrewer-package.Rd index 439f691..69fb103 100644 --- a/man/MexBrewer-package.Rd +++ b/man/MexBrewer-package.Rd @@ -6,7 +6,7 @@ \alias{MexBrewer-package} \title{MexBrewer: Color Palettes Inspired by Works of Mexican Painters and Muralists} \description{ -Palettes Inspired by Works of Mexican Muralists. +Color palettes inspired by the works of Mexican painters and muralists. The package includes functions that return vectors of colors and also functions to use color and fill scales in 'ggplot2' visualizations. } \seealso{ Useful links: diff --git a/man/df_mxstate_2020.Rd b/man/df_mxstate_2020.Rd index d81d8f2..3521b2d 100644 --- a/man/df_mxstate_2020.Rd +++ b/man/df_mxstate_2020.Rd @@ -10,6 +10,9 @@ An object of class \code{data.frame} with 32 rows and 11 columns. \usage{ df_mxstate_2020 } +\value{ +A data.frame +} \description{ A data.frame containing population estimates for all the Mexican states in 2020 } diff --git a/man/scale_colour_mex_c.Rd b/man/ggplot2-scales-continuous.Rd similarity index 54% rename from man/scale_colour_mex_c.Rd rename to man/ggplot2-scales-continuous.Rd index 32e0114..fc576da 100644 --- a/man/scale_colour_mex_c.Rd +++ b/man/ggplot2-scales-continuous.Rd @@ -1,10 +1,17 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/MexBrewer-package.R -\name{scale_colour_mex_c} +\name{ggplot2-scales-continuous} +\alias{ggplot2-scales-continuous} +\alias{scale_color_mex_c} \alias{scale_colour_mex_c} -\title{MexBrewer palettes for plotting with ggplot2} +\alias{scale_fill_mex_c} +\title{Continuous MexBrewer scales for use with ggplot2} \usage{ +scale_color_mex_c(palette_name, direction = 1, ...) + scale_colour_mex_c(palette_name, direction = 1, ...) + +scale_fill_mex_c(palette_name, direction = 1, ...) } \arguments{ \item{palette_name}{Name of Palette. Choices are: @@ -15,13 +22,14 @@ scale_colour_mex_c(palette_name, direction = 1, ...) \item{...}{Other arguments passed on to \code{\link[ggplot2]{scale_color_gradientn}}} } +\value{ +A \code{ScaleContinuous} object that can be added to a \code{ggplot} object +} \description{ -Function for using \code{MexBrewer} colors schemes in \code{ggplot2}. Use \code{\link{scale_color_mex_d}} and \code{\link{scale_fill_mex_d}} -for discrete scales and \code{\link{scale_color_mex_c}} and \code{\link{scale_fill_mex_c}} for continuous scales. +Functions \code{\link{scale_color_mex_c}} and \code{\link{scale_fill_mex_c}} for continuous scales enable the use of \code{MexBrewer} colors with \code{ggplot2} continuous scales. } -\examples{ -library(ggplot2) -ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Sepal.Length)) + -geom_point() + -scale_colour_mex_c("Concha", direction=-1) +\seealso{ +Other color scales: +\code{\link{ggplot2-scales-discrete}} } +\concept{color scales} diff --git a/man/scale_fill_mex_d.Rd b/man/ggplot2-scales-discrete.Rd similarity index 64% rename from man/scale_fill_mex_d.Rd rename to man/ggplot2-scales-discrete.Rd index 932caca..4e78f04 100644 --- a/man/scale_fill_mex_d.Rd +++ b/man/ggplot2-scales-discrete.Rd @@ -1,9 +1,16 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/MexBrewer-package.R -\name{scale_fill_mex_d} +\name{ggplot2-scales-discrete} +\alias{ggplot2-scales-discrete} +\alias{scale_color_mex_d} +\alias{scale_colour_mex_d} \alias{scale_fill_mex_d} -\title{MexBrewer palettes for plotting with ggplot2} +\title{Discrete MexBrewer scales for use with ggplot2} \usage{ +scale_color_mex_d(palette_name, direction = 1, override.order = FALSE, ...) + +scale_colour_mex_d(palette_name, direction = 1, override.order = FALSE, ...) + scale_fill_mex_d(palette_name, direction = 1, override.order = FALSE, ...) } \arguments{ @@ -19,9 +26,11 @@ colors are selected in sequential order from the full palette instead. Default i \item{...}{Other arguments passed on to \code{\link[ggplot2]{discrete_scale}}} } +\value{ +A \code{ScaleDiscrete} object that can be added to a \code{ggplot} object +} \description{ -Function for using \code{MexBrewer} colors schemes in \code{ggplot2}. Use \code{\link{scale_color_mex_d}} and \code{\link{scale_fill_mex_d}} -for discrete scales and \code{\link{scale_color_mex_c}} and \code{\link{scale_fill_mex_c}} for continuous scales. +Functions \code{\link{scale_color_mex_d}} and \code{\link{scale_fill_mex_d}} enable the use of \code{MexBrewer} colors with \code{ggplot2} discrete scales. } \examples{ library(ggplot2) @@ -29,3 +38,8 @@ ggplot(data=iris, aes(x=Species, y=Sepal.Length, fill=Species)) + geom_violin() + scale_fill_mex_d("Aurora") } +\seealso{ +Other color scales: +\code{\link{ggplot2-scales-continuous}} +} +\concept{color scales} diff --git a/man/mex.brewer.Rd b/man/mex.brewer.Rd index d1a656f..6a4b6e6 100644 --- a/man/mex.brewer.Rd +++ b/man/mex.brewer.Rd @@ -30,7 +30,7 @@ that colors are not always selected in sequential order from the full palette. I colors are selected in sequential order from the full palette instead. Default is FALSE.} } \value{ -A vector of colors. +A vector of colors for use in visualization tasks } \description{ These are a handful of color palettes from Mexican muralists. diff --git a/man/mx_estados.Rd b/man/mx_estados.Rd index ee9c796..e9679d0 100644 --- a/man/mx_estados.Rd +++ b/man/mx_estados.Rd @@ -16,6 +16,9 @@ A simple features data frame with 32 rows and 4 variables: \usage{ data(mx_estados) } +\value{ +A simple features data frame +} \description{ A simple features object with the boundaries of states in Mexico (unprojected; CRS is WGS 84). } diff --git a/man/scale_color_mex_c.Rd b/man/scale_color_mex_c.Rd deleted file mode 100644 index 0f3dd73..0000000 --- a/man/scale_color_mex_c.Rd +++ /dev/null @@ -1,27 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/MexBrewer-package.R -\name{scale_color_mex_c} -\alias{scale_color_mex_c} -\title{MexBrewer palettes for plotting with ggplot2} -\usage{ -scale_color_mex_c(palette_name, direction = 1, ...) -} -\arguments{ -\item{palette_name}{Name of Palette. Choices are: -\code{Alacena}, \code{Atentado}, \code{Aurora}, \code{Casita1}, \code{Casita2}, \code{Casita3}, \code{Concha}, \code{Frida}, \code{Huida}, \code{Maiz}, \code{Naturaleza},\code{Ofrenda}, -\code{Revolucion}, \code{Ronda}, \code{Taurus1}, \code{Taurus2},\code{Tierra}, \code{Vendedora}.} - -\item{direction}{Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed} - -\item{...}{Other arguments passed on to \code{\link[ggplot2]{scale_color_gradientn}}} -} -\description{ -Function for using \code{MexBrewer} colors schemes in \code{ggplot2}. Use \code{\link{scale_color_mex_d}} and \code{\link{scale_fill_mex_d}} -for discrete scales and \code{\link{scale_color_mex_c}} and \code{\link{scale_fill_mex_c}} for continuous scales. -} -\examples{ -library(ggplot2) -ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Sepal.Length)) + -geom_point() + -scale_color_mex_c("Tierra", direction=-1) -} diff --git a/man/scale_color_mex_d.Rd b/man/scale_color_mex_d.Rd deleted file mode 100644 index fc58fda..0000000 --- a/man/scale_color_mex_d.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/MexBrewer-package.R -\name{scale_color_mex_d} -\alias{scale_color_mex_d} -\title{MexBrewer palettes for plotting with ggplot2} -\usage{ -scale_color_mex_d(palette_name, direction = 1, override.order = FALSE, ...) -} -\arguments{ -\item{palette_name}{Name of Palette. Choices are: -\code{Alacena}, \code{Atentado}, \code{Aurora}, \code{Casita1}, \code{Casita2}, \code{Casita3}, \code{Concha}, \code{Frida}, \code{Huida}, \code{Maiz}, \code{Naturaleza},\code{Ofrenda}, -\code{Revolucion}, \code{Ronda}, \code{Taurus1}, \code{Taurus2},\code{Tierra}, \code{Vendedora}.} - -\item{direction}{Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed} - -\item{override.order}{Colors are picked from palette to maximize readability and aesthetics. This means -that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, -colors are selected in sequential order from the full palette instead. Default is FALSE.} - -\item{...}{Other arguments passed on to \code{\link[ggplot2]{discrete_scale}}} -} -\description{ -Function for using \code{MexBrewer} colors schemes in \code{ggplot2}. Use \code{\link{scale_color_mex_d}} and \code{\link{scale_fill_mex_d}} -for discrete scales and \code{\link{scale_color_mex_c}} and \code{\link{scale_fill_mex_c}} for continuous scales. -} -\examples{ -library(ggplot2) -ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + -geom_point() + -scale_color_mex_d("Atentado") -} diff --git a/man/scale_colour_mex_d.Rd b/man/scale_colour_mex_d.Rd deleted file mode 100644 index e9374e9..0000000 --- a/man/scale_colour_mex_d.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/MexBrewer-package.R -\name{scale_colour_mex_d} -\alias{scale_colour_mex_d} -\title{MexBrewer palettes for plotting with ggplot2} -\usage{ -scale_colour_mex_d(palette_name, direction = 1, override.order = FALSE, ...) -} -\arguments{ -\item{palette_name}{Name of Palette. Choices are: -\code{Alacena}, \code{Atentado}, \code{Aurora}, \code{Casita1}, \code{Casita2}, \code{Casita3}, \code{Concha}, \code{Frida}, \code{Huida}, \code{Maiz}, \code{Naturaleza},\code{Ofrenda}, -\code{Revolucion}, \code{Ronda}, \code{Taurus1}, \code{Taurus2},\code{Tierra}, \code{Vendedora}.} - -\item{direction}{Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed} - -\item{override.order}{Colors are picked from palette to maximize readability and aesthetics. This means -that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, -colors are selected in sequential order from the full palette instead. Default is FALSE.} - -\item{...}{Other arguments passed on to \code{\link[ggplot2]{discrete_scale}}} -} -\description{ -Function for using \code{MexBrewer} colors schemes in \code{ggplot2}. Use \code{\link{scale_color_mex_d}} and \code{\link{scale_fill_mex_d}} -for discrete scales and \code{\link{scale_color_mex_c}} and \code{\link{scale_fill_mex_c}} for continuous scales. -} -\examples{ -library(ggplot2) -ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + -geom_point() + -scale_colour_mex_d("Frida") -} diff --git a/man/scale_fill_mex_c.Rd b/man/scale_fill_mex_c.Rd deleted file mode 100644 index 53f746b..0000000 --- a/man/scale_fill_mex_c.Rd +++ /dev/null @@ -1,21 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/MexBrewer-package.R -\name{scale_fill_mex_c} -\alias{scale_fill_mex_c} -\title{MexBrewer palettes for plotting with ggplot2} -\usage{ -scale_fill_mex_c(palette_name, direction = 1, ...) -} -\arguments{ -\item{palette_name}{Name of Palette. Choices are: -\code{Alacena}, \code{Atentado}, \code{Aurora}, \code{Casita1}, \code{Casita2}, \code{Casita3}, \code{Concha}, \code{Frida}, \code{Huida}, \code{Maiz}, \code{Naturaleza},\code{Ofrenda}, -\code{Revolucion}, \code{Ronda}, \code{Taurus1}, \code{Taurus2},\code{Tierra}, \code{Vendedora}.} - -\item{direction}{Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed} - -\item{...}{Other arguments passed on to \code{\link[ggplot2]{scale_color_gradientn}}} -} -\description{ -Function for using \code{MexBrewer} colors schemes in \code{ggplot2}. Use \code{\link{scale_color_mex_d}} and \code{\link{scale_fill_mex_d}} -for discrete scales and \code{\link{scale_color_mex_c}} and \code{\link{scale_fill_mex_c}} for continuous scales. -}