diff --git a/R/continuous-gsea.R b/R/continuous-gsea.R index 3abf8af..5cf6640 100644 --- a/R/continuous-gsea.R +++ b/R/continuous-gsea.R @@ -29,7 +29,7 @@ rgb_gsea <- function(palette = c("default"), n = 12, alpha = 1, reverse = FALSE) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"gsea"[[palette]] func_cols <- colorRamp(raw_cols, space = "Lab", interpolate = "spline") @@ -97,7 +97,8 @@ pal_gsea <- function(palette = c("default"), n = 12, alpha = 1, reverse = FALSE) #' aes(x = Var1, y = Var2, fill = value) #' ) + #' geom_tile(colour = "black", size = 0.3) + -#' theme_bw() + scale_fill_gsea() +#' theme_bw() + +#' scale_fill_gsea() scale_color_gsea <- function(palette = c("default"), alpha = 1, reverse = FALSE, ...) { palette <- match.arg(palette) scale_color_gradientn(colours = rgb_gsea(palette, n = 512, alpha = alpha, reverse = reverse), ...) diff --git a/R/continuous-material.R b/R/continuous-material.R index bb1d913..7557e4c 100644 --- a/R/continuous-material.R +++ b/R/continuous-material.R @@ -47,14 +47,14 @@ #' show_col(pal_material("indigo")(10)) #' show_col(pal_material("indigo", n = 30, alpha = 0.6, reverse = TRUE)(30)) rgb_material <- function( - palette = c( - "red", "pink", "purple", "deep-purple", "indigo", "blue", - "light-blue", "cyan", "teal", "green", "light-green", "lime", - "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey" - ), n = 10, alpha = 1, reverse = FALSE) { + palette = c( + "red", "pink", "purple", "deep-purple", "indigo", "blue", + "light-blue", "cyan", "teal", "green", "light-green", "lime", + "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey" + ), n = 10, alpha = 1, reverse = FALSE) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"material"[[palette]] func_cols <- colorRamp(raw_cols, space = "Lab", interpolate = "spline") @@ -87,11 +87,11 @@ rgb_material <- function( #' show_col(pal_material("indigo")(10)) #' show_col(pal_material("indigo", n = 30, alpha = 0.6, reverse = TRUE)(30)) pal_material <- function( - palette = c( - "red", "pink", "purple", "deep-purple", "indigo", "blue", - "light-blue", "cyan", "teal", "green", "light-green", "lime", - "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey" - ), n = 10, alpha = 1, reverse = FALSE) { + palette = c( + "red", "pink", "purple", "deep-purple", "indigo", "blue", + "light-blue", "cyan", "teal", "green", "light-green", "lime", + "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey" + ), n = 10, alpha = 1, reverse = FALSE) { palette <- match.arg(palette) alpha_cols <- rgb_material(palette, n, alpha, reverse) @@ -127,13 +127,14 @@ pal_material <- function( #' aes(x = Var1, y = Var2, fill = value) #' ) + #' geom_tile(colour = "black", size = 0.3) + -#' theme_bw() + scale_fill_material("blue-grey") +#' theme_bw() + +#' scale_fill_material("blue-grey") scale_color_material <- function( - palette = c( - "red", "pink", "purple", "deep-purple", "indigo", "blue", - "light-blue", "cyan", "teal", "green", "light-green", "lime", - "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey" - ), alpha = 1, reverse = FALSE, ...) { + palette = c( + "red", "pink", "purple", "deep-purple", "indigo", "blue", + "light-blue", "cyan", "teal", "green", "light-green", "lime", + "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey" + ), alpha = 1, reverse = FALSE, ...) { palette <- match.arg(palette) scale_color_gradientn( colours = rgb_material( @@ -152,11 +153,11 @@ scale_colour_material <- scale_color_material #' @importFrom ggplot2 scale_fill_gradientn #' @rdname scale_material scale_fill_material <- function( - palette = c( - "red", "pink", "purple", "deep-purple", "indigo", "blue", - "light-blue", "cyan", "teal", "green", "light-green", "lime", - "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey" - ), alpha = 1, reverse = FALSE, ...) { + palette = c( + "red", "pink", "purple", "deep-purple", "indigo", "blue", + "light-blue", "cyan", "teal", "green", "light-green", "lime", + "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey" + ), alpha = 1, reverse = FALSE, ...) { palette <- match.arg(palette) scale_fill_gradientn( colours = rgb_material( diff --git a/R/discrete-aaas.R b/R/discrete-aaas.R index 20727a0..fe5a0fe 100644 --- a/R/discrete-aaas.R +++ b/R/discrete-aaas.R @@ -25,7 +25,7 @@ pal_aaas <- function(palette = c("default"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"aaas"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -64,17 +64,19 @@ pal_aaas <- function(palette = c("default"), alpha = 1) { #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_bw() + scale_color_aaas() +#' theme_bw() + +#' scale_color_aaas() #' #' ggplot( #' subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_bw() + scale_fill_aaas() +#' theme_bw() + +#' scale_fill_aaas() scale_color_aaas <- function(palette = c("default"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "aaas", pal_aaas(palette, alpha), ...) + discrete_scale("colour", palette = pal_aaas(palette, alpha), ...) } #' @export scale_colour_aaas @@ -86,5 +88,5 @@ scale_colour_aaas <- scale_color_aaas #' @rdname scale_aaas scale_fill_aaas <- function(palette = c("default"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "aaas", pal_aaas(palette, alpha), ...) + discrete_scale("fill", palette = pal_aaas(palette, alpha), ...) } diff --git a/R/discrete-cosmic.R b/R/discrete-cosmic.R index 4dbf781..585598e 100644 --- a/R/discrete-cosmic.R +++ b/R/discrete-cosmic.R @@ -30,11 +30,11 @@ #' show_col(pal_cosmic("signature_substitutions")(6)) #' show_col(pal_cosmic("signature_substitutions", alpha = 0.6)(6)) pal_cosmic <- function( - palette = c("hallmarks_light", "hallmarks_dark", "signature_substitutions"), - alpha = 1) { + palette = c("hallmarks_light", "hallmarks_dark", "signature_substitutions"), + alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"cosmic"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -73,19 +73,21 @@ pal_cosmic <- function( #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_bw() + scale_color_cosmic() +#' theme_bw() + +#' scale_color_cosmic() #' #' ggplot( #' subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_bw() + scale_fill_cosmic() +#' theme_bw() + +#' scale_fill_cosmic() scale_color_cosmic <- function( - palette = c("hallmarks_light", "hallmarks_dark", "signature_substitutions"), - alpha = 1, ...) { + palette = c("hallmarks_light", "hallmarks_dark", "signature_substitutions"), + alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "cosmic", pal_cosmic(palette, alpha), ...) + discrete_scale("colour", palette = pal_cosmic(palette, alpha), ...) } #' @export scale_colour_cosmic @@ -96,8 +98,8 @@ scale_colour_cosmic <- scale_color_cosmic #' @importFrom ggplot2 discrete_scale #' @rdname scale_cosmic scale_fill_cosmic <- function( - palette = c("hallmarks_light", "hallmarks_dark", "signature_substitutions"), - alpha = 1, ...) { + palette = c("hallmarks_light", "hallmarks_dark", "signature_substitutions"), + alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "cosmic", pal_cosmic(palette, alpha), ...) + discrete_scale("fill", palette = pal_cosmic(palette, alpha), ...) } diff --git a/R/discrete-d3.R b/R/discrete-d3.R index fc9e0e7..fc89a82 100644 --- a/R/discrete-d3.R +++ b/R/discrete-d3.R @@ -30,7 +30,7 @@ pal_d3 <- function(palette = c("category10", "category20", "category20b", "category20c"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"d3"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -93,7 +93,7 @@ pal_d3 <- function(palette = c("category10", "category20", "category20b", "categ #' p2 + scale_fill_d3(palette = "category20c") scale_color_d3 <- function(palette = c("category10", "category20", "category20b", "category20c"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "d3", pal_d3(palette, alpha), ...) + discrete_scale("colour", palette = pal_d3(palette, alpha), ...) } #' @export scale_colour_d3 @@ -105,5 +105,5 @@ scale_colour_d3 <- scale_color_d3 #' @rdname scale_d3 scale_fill_d3 <- function(palette = c("category10", "category20", "category20b", "category20c"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "d3", pal_d3(palette, alpha), ...) + discrete_scale("fill", palette = pal_d3(palette, alpha), ...) } diff --git a/R/discrete-flatui.R b/R/discrete-flatui.R index ef5023c..4554b9c 100644 --- a/R/discrete-flatui.R +++ b/R/discrete-flatui.R @@ -26,7 +26,7 @@ pal_flatui <- function(palette = c("default", "flattastic", "aussie"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"flatui"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -86,7 +86,7 @@ pal_flatui <- function(palette = c("default", "flattastic", "aussie"), alpha = 1 #' p2 + scale_fill_flatui(palette = "aussie") scale_color_flatui <- function(palette = c("default", "flattastic", "aussie"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "flatui", pal_flatui(palette, alpha), ...) + discrete_scale("colour", palette = pal_flatui(palette, alpha), ...) } #' @export scale_colour_flatui @@ -98,5 +98,5 @@ scale_colour_flatui <- scale_color_flatui #' @rdname scale_flatui scale_fill_flatui <- function(palette = c("default", "flattastic", "aussie"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "flatui", pal_flatui(palette, alpha), ...) + discrete_scale("fill", palette = pal_flatui(palette, alpha), ...) } diff --git a/R/discrete-frontiers.R b/R/discrete-frontiers.R index 3c06623..603744f 100644 --- a/R/discrete-frontiers.R +++ b/R/discrete-frontiers.R @@ -22,7 +22,7 @@ pal_frontiers <- function(palette = c("default"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"frontiers"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -60,7 +60,8 @@ pal_frontiers <- function(palette = c("default"), alpha = 1) { #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_dark() + theme( +#' theme_dark() + +#' theme( #' panel.background = element_rect(fill = "#2D2D2D"), #' legend.key = element_rect(fill = "#2D2D2D") #' ) + @@ -71,13 +72,14 @@ pal_frontiers <- function(palette = c("default"), alpha = 1) { #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_dark() + theme( +#' theme_dark() + +#' theme( #' panel.background = element_rect(fill = "#2D2D2D") #' ) + #' scale_fill_frontiers() scale_color_frontiers <- function(palette = c("default"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "frontiers", pal_frontiers(palette, alpha), ...) + discrete_scale("colour", palette = pal_frontiers(palette, alpha), ...) } #' @export scale_colour_frontiers @@ -89,5 +91,5 @@ scale_colour_frontiers <- scale_color_frontiers #' @rdname scale_frontiers scale_fill_frontiers <- function(palette = c("default"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "frontiers", pal_frontiers(palette, alpha), ...) + discrete_scale("fill", palette = pal_frontiers(palette, alpha), ...) } diff --git a/R/discrete-futurama.R b/R/discrete-futurama.R index 9f0b277..683bb46 100644 --- a/R/discrete-futurama.R +++ b/R/discrete-futurama.R @@ -23,7 +23,7 @@ pal_futurama <- function(palette = c("planetexpress"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"futurama"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -62,17 +62,19 @@ pal_futurama <- function(palette = c("planetexpress"), alpha = 1) { #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_bw() + scale_color_futurama() +#' theme_bw() + +#' scale_color_futurama() #' #' ggplot( #' subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_bw() + scale_fill_futurama() +#' theme_bw() + +#' scale_fill_futurama() scale_color_futurama <- function(palette = c("planetexpress"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "futurama", pal_futurama(palette, alpha), ...) + discrete_scale("colour", palette = pal_futurama(palette, alpha), ...) } #' @export scale_colour_futurama @@ -84,5 +86,5 @@ scale_colour_futurama <- scale_color_futurama #' @rdname scale_futurama scale_fill_futurama <- function(palette = c("planetexpress"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "futurama", pal_futurama(palette, alpha), ...) + discrete_scale("fill", palette = pal_futurama(palette, alpha), ...) } diff --git a/R/discrete-igv.R b/R/discrete-igv.R index 55f9c71..096b62d 100644 --- a/R/discrete-igv.R +++ b/R/discrete-igv.R @@ -30,7 +30,7 @@ pal_igv <- function(palette = c("default", "alternating"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"igv"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -89,7 +89,7 @@ pal_igv <- function(palette = c("default", "alternating"), alpha = 1) { #' ) scale_color_igv <- function(palette = c("default", "alternating"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "igv", pal_igv(palette, alpha), ...) + discrete_scale("colour", palette = pal_igv(palette, alpha), ...) } #' @export scale_colour_igv @@ -101,5 +101,5 @@ scale_colour_igv <- scale_color_igv #' @rdname scale_igv scale_fill_igv <- function(palette = c("default", "alternating"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "igv", pal_igv(palette, alpha), ...) + discrete_scale("fill", palette = pal_igv(palette, alpha), ...) } diff --git a/R/discrete-jama.R b/R/discrete-jama.R index 8e97fb0..5bfa643 100644 --- a/R/discrete-jama.R +++ b/R/discrete-jama.R @@ -24,7 +24,7 @@ pal_jama <- function(palette = c("default"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"jama"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -56,24 +56,26 @@ pal_jama <- function(palette = c("default"), alpha = 1) { #' @examples #' library("ggplot2") #' data("diamonds") -#' +#' #' ggplot( #' subset(diamonds, carat >= 2.2), #' aes(x = table, y = price, colour = cut) #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_bw() + scale_color_jama() -#' +#' theme_bw() + +#' scale_color_jama() +#' #' ggplot( #' subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_bw() + scale_fill_jama() +#' theme_bw() + +#' scale_fill_jama() scale_color_jama <- function(palette = c("default"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "jama", pal_jama(palette, alpha), ...) + discrete_scale("colour", palette = pal_jama(palette, alpha), ...) } #' @export scale_colour_jama @@ -85,5 +87,5 @@ scale_colour_jama <- scale_color_jama #' @rdname scale_jama scale_fill_jama <- function(palette = c("default"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "jama", pal_jama(palette, alpha), ...) + discrete_scale("fill", palette = pal_jama(palette, alpha), ...) } diff --git a/R/discrete-jco.R b/R/discrete-jco.R index d8af201..f987737 100644 --- a/R/discrete-jco.R +++ b/R/discrete-jco.R @@ -23,7 +23,7 @@ pal_jco <- function(palette = c("default"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"jco"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -55,24 +55,26 @@ pal_jco <- function(palette = c("default"), alpha = 1) { #' @examples #' library("ggplot2") #' data("diamonds") -#' +#' #' ggplot( #' subset(diamonds, carat >= 2.2), #' aes(x = table, y = price, colour = cut) #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_bw() + scale_color_jco() -#' +#' theme_bw() + +#' scale_color_jco() +#' #' ggplot( #' subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_bw() + scale_fill_jco() +#' theme_bw() + +#' scale_fill_jco() scale_color_jco <- function(palette = c("default"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "jco", pal_jco(palette, alpha), ...) + discrete_scale("colour", palette = pal_jco(palette, alpha), ...) } #' @export scale_colour_jco @@ -84,5 +86,5 @@ scale_colour_jco <- scale_color_jco #' @rdname scale_jco scale_fill_jco <- function(palette = c("default"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "jco", pal_jco(palette, alpha), ...) + discrete_scale("fill", palette = pal_jco(palette, alpha), ...) } diff --git a/R/discrete-lancet.R b/R/discrete-lancet.R index cbb4823..f48d0d0 100644 --- a/R/discrete-lancet.R +++ b/R/discrete-lancet.R @@ -24,7 +24,7 @@ pal_lancet <- function(palette = c("lanonc"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"lancet"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -56,24 +56,26 @@ pal_lancet <- function(palette = c("lanonc"), alpha = 1) { #' @examples #' library("ggplot2") #' data("diamonds") -#' +#' #' ggplot( #' subset(diamonds, carat >= 2.2), #' aes(x = table, y = price, colour = cut) #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_bw() + scale_color_lancet() -#' +#' theme_bw() + +#' scale_color_lancet() +#' #' ggplot( #' subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_bw() + scale_fill_lancet() +#' theme_bw() + +#' scale_fill_lancet() scale_color_lancet <- function(palette = c("lanonc"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "lancet", pal_lancet(palette, alpha), ...) + discrete_scale("colour", palette = pal_lancet(palette, alpha), ...) } #' @export scale_colour_lancet @@ -85,5 +87,5 @@ scale_colour_lancet <- scale_color_lancet #' @rdname scale_lancet scale_fill_lancet <- function(palette = c("lanonc"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "lancet", pal_lancet(palette, alpha), ...) + discrete_scale("fill", palette = pal_lancet(palette, alpha), ...) } diff --git a/R/discrete-locuszoom.R b/R/discrete-locuszoom.R index 1aded0f..dfd4773 100644 --- a/R/discrete-locuszoom.R +++ b/R/discrete-locuszoom.R @@ -28,7 +28,7 @@ pal_locuszoom <- function(palette = c("default"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"locuszoom"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -60,24 +60,26 @@ pal_locuszoom <- function(palette = c("default"), alpha = 1) { #' @examples #' library("ggplot2") #' data("diamonds") -#' +#' #' ggplot( #' subset(diamonds, carat >= 2.2), #' aes(x = table, y = price, colour = cut) #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_bw() + scale_color_locuszoom() -#' +#' theme_bw() + +#' scale_color_locuszoom() +#' #' ggplot( #' subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_bw() + scale_fill_locuszoom() +#' theme_bw() + +#' scale_fill_locuszoom() scale_color_locuszoom <- function(palette = c("default"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "locuszoom", pal_locuszoom(palette, alpha), ...) + discrete_scale("colour", palette = pal_locuszoom(palette, alpha), ...) } #' @export scale_colour_locuszoom @@ -89,5 +91,5 @@ scale_colour_locuszoom <- scale_color_locuszoom #' @rdname scale_locuszoom scale_fill_locuszoom <- function(palette = c("default"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "locuszoom", pal_locuszoom(palette, alpha), ...) + discrete_scale("fill", palette = pal_locuszoom(palette, alpha), ...) } diff --git a/R/discrete-nejm.R b/R/discrete-nejm.R index c227e59..d6849bd 100644 --- a/R/discrete-nejm.R +++ b/R/discrete-nejm.R @@ -24,7 +24,7 @@ pal_nejm <- function(palette = c("default"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"nejm"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -56,24 +56,26 @@ pal_nejm <- function(palette = c("default"), alpha = 1) { #' @examples #' library("ggplot2") #' data("diamonds") -#' +#' #' ggplot( #' subset(diamonds, carat >= 2.2), #' aes(x = table, y = price, colour = cut) #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_bw() + scale_color_nejm() -#' +#' theme_bw() + +#' scale_color_nejm() +#' #' ggplot( #' subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_bw() + scale_fill_nejm() +#' theme_bw() + +#' scale_fill_nejm() scale_color_nejm <- function(palette = c("default"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "nejm", pal_nejm(palette, alpha), ...) + discrete_scale("colour", palette = pal_nejm(palette, alpha), ...) } #' @export scale_colour_nejm @@ -85,5 +87,5 @@ scale_colour_nejm <- scale_color_nejm #' @rdname scale_nejm scale_fill_nejm <- function(palette = c("default"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "nejm", pal_nejm(palette, alpha), ...) + discrete_scale("fill", palette = pal_nejm(palette, alpha), ...) } diff --git a/R/discrete-npg.R b/R/discrete-npg.R index 920052b..24d1789 100644 --- a/R/discrete-npg.R +++ b/R/discrete-npg.R @@ -24,7 +24,7 @@ pal_npg <- function(palette = c("nrc"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"npg"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -56,24 +56,26 @@ pal_npg <- function(palette = c("nrc"), alpha = 1) { #' @examples #' library("ggplot2") #' data("diamonds") -#' +#' #' ggplot( #' subset(diamonds, carat >= 2.2), #' aes(x = table, y = price, colour = cut) #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_bw() + scale_color_npg() -#' +#' theme_bw() + +#' scale_color_npg() +#' #' ggplot( #' subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_bw() + scale_fill_npg() +#' theme_bw() + +#' scale_fill_npg() scale_color_npg <- function(palette = c("nrc"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "npg", pal_npg(palette, alpha), ...) + discrete_scale("colour", palette = pal_npg(palette, alpha), ...) } #' @export scale_colour_npg @@ -85,5 +87,5 @@ scale_colour_npg <- scale_color_npg #' @rdname scale_npg scale_fill_npg <- function(palette = c("nrc"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "npg", pal_npg(palette, alpha), ...) + discrete_scale("fill", palette = pal_npg(palette, alpha), ...) } diff --git a/R/discrete-rickandmorty.R b/R/discrete-rickandmorty.R index bffa9b0..ba7d4cc 100644 --- a/R/discrete-rickandmorty.R +++ b/R/discrete-rickandmorty.R @@ -23,7 +23,7 @@ pal_rickandmorty <- function(palette = c("schwifty"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"rickandmorty"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -55,24 +55,26 @@ pal_rickandmorty <- function(palette = c("schwifty"), alpha = 1) { #' @examples #' library("ggplot2") #' data("diamonds") -#' +#' #' ggplot( #' subset(diamonds, carat >= 2.2), #' aes(x = table, y = price, colour = cut) #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_bw() + scale_color_rickandmorty() -#' +#' theme_bw() + +#' scale_color_rickandmorty() +#' #' ggplot( #' subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_bw() + scale_fill_rickandmorty() +#' theme_bw() + +#' scale_fill_rickandmorty() scale_color_rickandmorty <- function(palette = c("schwifty"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "rickandmorty", pal_rickandmorty(palette, alpha), ...) + discrete_scale("colour", palette = pal_rickandmorty(palette, alpha), ...) } #' @export scale_colour_rickandmorty @@ -84,5 +86,5 @@ scale_colour_rickandmorty <- scale_color_rickandmorty #' @rdname scale_rickandmorty scale_fill_rickandmorty <- function(palette = c("schwifty"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "rickandmorty", pal_rickandmorty(palette, alpha), ...) + discrete_scale("fill", palette = pal_rickandmorty(palette, alpha), ...) } diff --git a/R/discrete-simpsons.R b/R/discrete-simpsons.R index f9063ea..07c5b68 100644 --- a/R/discrete-simpsons.R +++ b/R/discrete-simpsons.R @@ -23,7 +23,7 @@ pal_simpsons <- function(palette = c("springfield"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"simpsons"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -55,24 +55,26 @@ pal_simpsons <- function(palette = c("springfield"), alpha = 1) { #' @examples #' library("ggplot2") #' data("diamonds") -#' +#' #' ggplot( #' subset(diamonds, carat >= 2.2), #' aes(x = table, y = price, colour = cut) #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_bw() + scale_color_simpsons() -#' +#' theme_bw() + +#' scale_color_simpsons() +#' #' ggplot( #' subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_bw() + scale_fill_simpsons() +#' theme_bw() + +#' scale_fill_simpsons() scale_color_simpsons <- function(palette = c("springfield"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "simpsons", pal_simpsons(palette, alpha), ...) + discrete_scale("colour", palette = pal_simpsons(palette, alpha), ...) } #' @export scale_colour_simpsons @@ -84,5 +86,5 @@ scale_colour_simpsons <- scale_color_simpsons #' @rdname scale_simpsons scale_fill_simpsons <- function(palette = c("springfield"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "simpsons", pal_simpsons(palette, alpha), ...) + discrete_scale("fill", palette = pal_simpsons(palette, alpha), ...) } diff --git a/R/discrete-startrek.R b/R/discrete-startrek.R index e2298dd..e7572d1 100644 --- a/R/discrete-startrek.R +++ b/R/discrete-startrek.R @@ -23,7 +23,7 @@ pal_startrek <- function(palette = c("uniform"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"startrek"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -55,24 +55,26 @@ pal_startrek <- function(palette = c("uniform"), alpha = 1) { #' @examples #' library("ggplot2") #' data("diamonds") -#' +#' #' ggplot( #' subset(diamonds, carat >= 2.2), #' aes(x = table, y = price, colour = cut) #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_bw() + scale_color_startrek() -#' +#' theme_bw() + +#' scale_color_startrek() +#' #' ggplot( #' subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_bw() + scale_fill_startrek() +#' theme_bw() + +#' scale_fill_startrek() scale_color_startrek <- function(palette = c("uniform"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "startrek", pal_startrek(palette, alpha), ...) + discrete_scale("colour", palette = pal_startrek(palette, alpha), ...) } #' @export scale_colour_startrek @@ -84,5 +86,5 @@ scale_colour_startrek <- scale_color_startrek #' @rdname scale_startrek scale_fill_startrek <- function(palette = c("uniform"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "startrek", pal_startrek(palette, alpha), ...) + discrete_scale("fill", palette = pal_startrek(palette, alpha), ...) } diff --git a/R/discrete-tron.R b/R/discrete-tron.R index a4b0884..c6d0526 100644 --- a/R/discrete-tron.R +++ b/R/discrete-tron.R @@ -23,7 +23,7 @@ pal_tron <- function(palette = c("legacy"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"tron"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -55,31 +55,33 @@ pal_tron <- function(palette = c("legacy"), alpha = 1) { #' @examples #' library("ggplot2") #' data("diamonds") -#' +#' #' ggplot( #' subset(diamonds, carat >= 2.2), #' aes(x = table, y = price, colour = cut) #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_dark() + theme( +#' theme_dark() + +#' theme( #' panel.background = element_rect(fill = "#2D2D2D"), #' legend.key = element_rect(fill = "#2D2D2D") #' ) + #' scale_color_tron() -#' +#' #' ggplot( #' subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_dark() + theme( +#' theme_dark() + +#' theme( #' panel.background = element_rect(fill = "#2D2D2D") #' ) + #' scale_fill_tron() scale_color_tron <- function(palette = c("legacy"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "tron", pal_tron(palette, alpha), ...) + discrete_scale("colour", palette = pal_tron(palette, alpha), ...) } #' @export scale_colour_tron @@ -91,5 +93,5 @@ scale_colour_tron <- scale_color_tron #' @rdname scale_tron scale_fill_tron <- function(palette = c("legacy"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "tron", pal_tron(palette, alpha), ...) + discrete_scale("fill", palette = pal_tron(palette, alpha), ...) } diff --git a/R/discrete-uchicago.R b/R/discrete-uchicago.R index 8487869..cc24fc6 100644 --- a/R/discrete-uchicago.R +++ b/R/discrete-uchicago.R @@ -28,7 +28,7 @@ pal_uchicago <- function(palette = c("default", "light", "dark"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"uchicago"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -88,7 +88,7 @@ pal_uchicago <- function(palette = c("default", "light", "dark"), alpha = 1) { #' p2 + scale_fill_uchicago(palette = "dark") scale_color_uchicago <- function(palette = c("default", "light", "dark"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "uchicago", pal_uchicago(palette, alpha), ...) + discrete_scale("colour", palette = pal_uchicago(palette, alpha), ...) } #' @export scale_colour_uchicago @@ -100,5 +100,5 @@ scale_colour_uchicago <- scale_color_uchicago #' @rdname scale_uchicago scale_fill_uchicago <- function(palette = c("default", "light", "dark"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "uchicago", pal_uchicago(palette, alpha), ...) + discrete_scale("fill", palette = pal_uchicago(palette, alpha), ...) } diff --git a/R/discrete-ucscgb.R b/R/discrete-ucscgb.R index 2546675..86ff1c6 100644 --- a/R/discrete-ucscgb.R +++ b/R/discrete-ucscgb.R @@ -23,7 +23,7 @@ pal_ucscgb <- function(palette = c("default"), alpha = 1) { palette <- match.arg(palette) - if (alpha > 1L | alpha <= 0L) stop("alpha must be in (0, 1]") + if (alpha > 1L || alpha <= 0L) stop("alpha must be in (0, 1]") raw_cols <- ggsci_db$"ucscgb"[[palette]] raw_cols_rgb <- col2rgb(raw_cols) @@ -55,24 +55,26 @@ pal_ucscgb <- function(palette = c("default"), alpha = 1) { #' @examples #' library("ggplot2") #' data("diamonds") -#' +#' #' ggplot( #' subset(diamonds, carat >= 2.2), #' aes(x = table, y = price, colour = cut) #' ) + #' geom_point(alpha = 0.7) + #' geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + -#' theme_bw() + scale_color_ucscgb() -#' +#' theme_bw() + +#' scale_color_ucscgb() +#' #' ggplot( #' subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), #' aes(x = depth, fill = cut) #' ) + #' geom_histogram(colour = "black", binwidth = 1, position = "dodge") + -#' theme_bw() + scale_fill_ucscgb() +#' theme_bw() + +#' scale_fill_ucscgb() scale_color_ucscgb <- function(palette = c("default"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("colour", "ucscgb", pal_ucscgb(palette, alpha), ...) + discrete_scale("colour", palette = pal_ucscgb(palette, alpha), ...) } #' @export scale_colour_ucscgb @@ -84,5 +86,5 @@ scale_colour_ucscgb <- scale_color_ucscgb #' @rdname scale_ucscgb scale_fill_ucscgb <- function(palette = c("default"), alpha = 1, ...) { palette <- match.arg(palette) - discrete_scale("fill", "ucscgb", pal_ucscgb(palette, alpha), ...) + discrete_scale("fill", palette = pal_ucscgb(palette, alpha), ...) } diff --git a/data-raw/data-generator.R b/data-raw/data-generator.R index 7dafa2f..67e7a43 100644 --- a/data-raw/data-generator.R +++ b/data-raw/data-generator.R @@ -1,5 +1,4 @@ -# Generate internal color palettes data `R/sysdata.rda` -# +# Generate internal color palettes data `R/sysdata.rda`: # - R Packages - Internal data. # - Name that Color. @@ -477,54 +476,54 @@ ggsci_db$"material"$"blue-grey" <- c( save(ggsci_db, file = "R/sysdata.rda") -# test_barplot <- function(palette, type) { -# pal <- ggsci_db[[palette]][[type]] -# barplot(rep(1, length(pal)), col = pal) -# } -# -# test_barplot("npg", "nrc") -# test_barplot("aaas", "default") -# test_barplot("nejm", "default") -# test_barplot("lancet", "lanonc") -# test_barplot("jama", "default") -# test_barplot("jco", "default") -# test_barplot("ucscgb", "default") -# test_barplot("d3", "category10") -# test_barplot("d3", "category20") -# test_barplot("d3", "category20b") -# test_barplot("d3", "category20c") -# test_barplot("locuszoom", "default") -# test_barplot("igv", "default") -# test_barplot("igv", "alternating") -# test_barplot("uchicago", "default") -# test_barplot("uchicago", "light") -# test_barplot("uchicago", "dark") -# test_barplot("cosmic", "hallmarks_dark") -# test_barplot("cosmic", "hallmarks_light") -# test_barplot("cosmic", "signature_substitutions") -# test_barplot("startrek", "uniform") -# test_barplot("tron", "legacy") -# test_barplot("futurama", "planetexpress") -# test_barplot("rickandmorty", "schwifty") -# test_barplot("simpsons", "springfield") -# test_barplot("gsea", "default") -# test_barplot("flatuiau", "intense") -# test_barplot("material", "red") -# test_barplot("material", "pink") -# test_barplot("material", "purple") -# test_barplot("material", "deep-purple") -# test_barplot("material", "indigo") -# test_barplot("material", "blue") -# test_barplot("material", "light-blue") -# test_barplot("material", "cyan") -# test_barplot("material", "teal") -# test_barplot("material", "green") -# test_barplot("material", "light-green") -# test_barplot("material", "lime") -# test_barplot("material", "yellow") -# test_barplot("material", "amber") -# test_barplot("material", "orange") -# test_barplot("material", "deep-orange") -# test_barplot("material", "brown") -# test_barplot("material", "grey") -# test_barplot("material", "blue-grey") +test_barplot <- function(palette, type) { + pal <- ggsci_db[[palette]][[type]] + barplot(rep(1, length(pal)), col = pal) +} + +test_barplot("npg", "nrc") +test_barplot("aaas", "default") +test_barplot("nejm", "default") +test_barplot("lancet", "lanonc") +test_barplot("jama", "default") +test_barplot("jco", "default") +test_barplot("ucscgb", "default") +test_barplot("d3", "category10") +test_barplot("d3", "category20") +test_barplot("d3", "category20b") +test_barplot("d3", "category20c") +test_barplot("locuszoom", "default") +test_barplot("igv", "default") +test_barplot("igv", "alternating") +test_barplot("uchicago", "default") +test_barplot("uchicago", "light") +test_barplot("uchicago", "dark") +test_barplot("cosmic", "hallmarks_dark") +test_barplot("cosmic", "hallmarks_light") +test_barplot("cosmic", "signature_substitutions") +test_barplot("startrek", "uniform") +test_barplot("tron", "legacy") +test_barplot("futurama", "planetexpress") +test_barplot("rickandmorty", "schwifty") +test_barplot("simpsons", "springfield") +test_barplot("gsea", "default") +test_barplot("flatuiau", "intense") +test_barplot("material", "red") +test_barplot("material", "pink") +test_barplot("material", "purple") +test_barplot("material", "deep-purple") +test_barplot("material", "indigo") +test_barplot("material", "blue") +test_barplot("material", "light-blue") +test_barplot("material", "cyan") +test_barplot("material", "teal") +test_barplot("material", "green") +test_barplot("material", "light-green") +test_barplot("material", "lime") +test_barplot("material", "yellow") +test_barplot("material", "amber") +test_barplot("material", "orange") +test_barplot("material", "deep-orange") +test_barplot("material", "brown") +test_barplot("material", "grey") +test_barplot("material", "blue-grey") diff --git a/man/scale_aaas.Rd b/man/scale_aaas.Rd index 13b0246..76d7ea7 100644 --- a/man/scale_aaas.Rd +++ b/man/scale_aaas.Rd @@ -35,14 +35,16 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_bw() + scale_color_aaas() + theme_bw() + + scale_color_aaas() ggplot( subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_bw() + scale_fill_aaas() + theme_bw() + + scale_fill_aaas() } \author{ Nan Xiao <\email{me@nanx.me}> | diff --git a/man/scale_cosmic.Rd b/man/scale_cosmic.Rd index b84ba40..08a7b4e 100644 --- a/man/scale_cosmic.Rd +++ b/man/scale_cosmic.Rd @@ -49,14 +49,16 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_bw() + scale_color_cosmic() + theme_bw() + + scale_color_cosmic() ggplot( subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_bw() + scale_fill_cosmic() + theme_bw() + + scale_fill_cosmic() } \author{ Joshua H. Cook <\email{joshuacook0023@gmail.com}> | diff --git a/man/scale_frontiers.Rd b/man/scale_frontiers.Rd index 59290c4..1221889 100644 --- a/man/scale_frontiers.Rd +++ b/man/scale_frontiers.Rd @@ -35,7 +35,8 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_dark() + theme( + theme_dark() + + theme( panel.background = element_rect(fill = "#2D2D2D"), legend.key = element_rect(fill = "#2D2D2D") ) + @@ -46,7 +47,8 @@ ggplot( aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_dark() + theme( + theme_dark() + + theme( panel.background = element_rect(fill = "#2D2D2D") ) + scale_fill_frontiers() diff --git a/man/scale_futurama.Rd b/man/scale_futurama.Rd index 343bf7a..31b7a39 100644 --- a/man/scale_futurama.Rd +++ b/man/scale_futurama.Rd @@ -35,14 +35,16 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_bw() + scale_color_futurama() + theme_bw() + + scale_color_futurama() ggplot( subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_bw() + scale_fill_futurama() + theme_bw() + + scale_fill_futurama() } \author{ Nan Xiao <\email{me@nanx.me}> | diff --git a/man/scale_gsea.Rd b/man/scale_gsea.Rd index 96d4044..45e89a1 100644 --- a/man/scale_gsea.Rd +++ b/man/scale_gsea.Rd @@ -40,7 +40,8 @@ ggplot( aes(x = Var1, y = Var2, fill = value) ) + geom_tile(colour = "black", size = 0.3) + - theme_bw() + scale_fill_gsea() + theme_bw() + + scale_fill_gsea() } \author{ Nan Xiao <\email{me@nanx.me}> | diff --git a/man/scale_jama.Rd b/man/scale_jama.Rd index 0d9e5e2..1831ff3 100644 --- a/man/scale_jama.Rd +++ b/man/scale_jama.Rd @@ -35,14 +35,16 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_bw() + scale_color_jama() + theme_bw() + + scale_color_jama() ggplot( subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_bw() + scale_fill_jama() + theme_bw() + + scale_fill_jama() } \author{ Nan Xiao <\email{me@nanx.me}> | diff --git a/man/scale_jco.Rd b/man/scale_jco.Rd index fd827d2..fbb5a4e 100644 --- a/man/scale_jco.Rd +++ b/man/scale_jco.Rd @@ -35,14 +35,16 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_bw() + scale_color_jco() + theme_bw() + + scale_color_jco() ggplot( subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_bw() + scale_fill_jco() + theme_bw() + + scale_fill_jco() } \author{ Nan Xiao <\email{me@nanx.me}> | diff --git a/man/scale_lancet.Rd b/man/scale_lancet.Rd index 22d709f..f42d332 100644 --- a/man/scale_lancet.Rd +++ b/man/scale_lancet.Rd @@ -35,14 +35,16 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_bw() + scale_color_lancet() + theme_bw() + + scale_color_lancet() ggplot( subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_bw() + scale_fill_lancet() + theme_bw() + + scale_fill_lancet() } \author{ Nan Xiao <\email{me@nanx.me}> | diff --git a/man/scale_locuszoom.Rd b/man/scale_locuszoom.Rd index a1d08bc..e01fa45 100644 --- a/man/scale_locuszoom.Rd +++ b/man/scale_locuszoom.Rd @@ -35,14 +35,16 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_bw() + scale_color_locuszoom() + theme_bw() + + scale_color_locuszoom() ggplot( subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_bw() + scale_fill_locuszoom() + theme_bw() + + scale_fill_locuszoom() } \author{ Nan Xiao <\email{me@nanx.me}> | diff --git a/man/scale_material.Rd b/man/scale_material.Rd index 87840ea..20b94e6 100644 --- a/man/scale_material.Rd +++ b/man/scale_material.Rd @@ -82,7 +82,8 @@ ggplot( aes(x = Var1, y = Var2, fill = value) ) + geom_tile(colour = "black", size = 0.3) + - theme_bw() + scale_fill_material("blue-grey") + theme_bw() + + scale_fill_material("blue-grey") } \author{ Nan Xiao <\email{me@nanx.me}> | diff --git a/man/scale_nejm.Rd b/man/scale_nejm.Rd index 27b4175..b2b08cb 100644 --- a/man/scale_nejm.Rd +++ b/man/scale_nejm.Rd @@ -35,14 +35,16 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_bw() + scale_color_nejm() + theme_bw() + + scale_color_nejm() ggplot( subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_bw() + scale_fill_nejm() + theme_bw() + + scale_fill_nejm() } \author{ Nan Xiao <\email{me@nanx.me}> | diff --git a/man/scale_npg.Rd b/man/scale_npg.Rd index 07c0137..b08d137 100644 --- a/man/scale_npg.Rd +++ b/man/scale_npg.Rd @@ -35,14 +35,16 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_bw() + scale_color_npg() + theme_bw() + + scale_color_npg() ggplot( subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_bw() + scale_fill_npg() + theme_bw() + + scale_fill_npg() } \author{ Nan Xiao <\email{me@nanx.me}> | diff --git a/man/scale_rickandmorty.Rd b/man/scale_rickandmorty.Rd index 8186006..2e8eb1d 100644 --- a/man/scale_rickandmorty.Rd +++ b/man/scale_rickandmorty.Rd @@ -35,14 +35,16 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_bw() + scale_color_rickandmorty() + theme_bw() + + scale_color_rickandmorty() ggplot( subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_bw() + scale_fill_rickandmorty() + theme_bw() + + scale_fill_rickandmorty() } \author{ Nan Xiao <\email{me@nanx.me}> | diff --git a/man/scale_simpsons.Rd b/man/scale_simpsons.Rd index 03cac57..eda73f3 100644 --- a/man/scale_simpsons.Rd +++ b/man/scale_simpsons.Rd @@ -35,14 +35,16 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_bw() + scale_color_simpsons() + theme_bw() + + scale_color_simpsons() ggplot( subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_bw() + scale_fill_simpsons() + theme_bw() + + scale_fill_simpsons() } \author{ Nan Xiao <\email{me@nanx.me}> | diff --git a/man/scale_startrek.Rd b/man/scale_startrek.Rd index 4f46409..3ca8727 100644 --- a/man/scale_startrek.Rd +++ b/man/scale_startrek.Rd @@ -35,14 +35,16 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_bw() + scale_color_startrek() + theme_bw() + + scale_color_startrek() ggplot( subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_bw() + scale_fill_startrek() + theme_bw() + + scale_fill_startrek() } \author{ Nan Xiao <\email{me@nanx.me}> | diff --git a/man/scale_tron.Rd b/man/scale_tron.Rd index 5a0bed0..a1ccffb 100644 --- a/man/scale_tron.Rd +++ b/man/scale_tron.Rd @@ -35,7 +35,8 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_dark() + theme( + theme_dark() + + theme( panel.background = element_rect(fill = "#2D2D2D"), legend.key = element_rect(fill = "#2D2D2D") ) + @@ -46,7 +47,8 @@ ggplot( aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_dark() + theme( + theme_dark() + + theme( panel.background = element_rect(fill = "#2D2D2D") ) + scale_fill_tron() diff --git a/man/scale_ucscgb.Rd b/man/scale_ucscgb.Rd index 88a5cdc..48967e1 100644 --- a/man/scale_ucscgb.Rd +++ b/man/scale_ucscgb.Rd @@ -35,14 +35,16 @@ ggplot( ) + geom_point(alpha = 0.7) + geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) + - theme_bw() + scale_color_ucscgb() + theme_bw() + + scale_color_ucscgb() ggplot( subset(diamonds, carat > 2.2 & depth > 55 & depth < 70), aes(x = depth, fill = cut) ) + geom_histogram(colour = "black", binwidth = 1, position = "dodge") + - theme_bw() + scale_fill_ucscgb() + theme_bw() + + scale_fill_ucscgb() } \author{ Nan Xiao <\email{me@nanx.me}> |