| show_palettes | R Documentation |
This function displays color palettes using ggplot2.
show_palettes(
palettes = NULL,
type = c("discrete", "continuous"),
index = NULL,
palette_names = NULL,
return_names = TRUE,
return_palettes = FALSE
)
palettes |
A list of color palettes.
Default is |
type |
The type of palettes to include.
Default is |
index |
The indices of the palettes to include.
Default is |
palette_names |
The names of the palettes to include.
Default is |
return_names |
Whether to return the names of the selected palettes.
Default is |
return_palettes |
Whether to return the colors of selected palettes.
Default is |
If return_palettes is TRUE, returns a list of color palettes. If return_names is TRUE (default), returns a character vector of palette names. Otherwise, returns NULL (called for side effects to display the plot).
palette_colors, palette_list
show_palettes(
palettes = list(
c("red", "blue", "green"),
c("yellow", "purple", "orange")
)
)
all_palettes <- show_palettes(return_palettes = TRUE)
names(all_palettes)
all_palettes[["simspec"]]
show_palettes(index = 1:10)
show_palettes(
type = "discrete",
index = 1:10
)
show_palettes(
type = "continuous",
index = 1:10
)
show_palettes(
palette_names = c(
"Paired", "nejm", "simspec", "Spectral", "jet", "Chinese"
),
return_palettes = TRUE
)
# Include Chinese palettes via prefix
show_palettes(
palette_names = c("ChineseRed", "ChineseBlue"),
return_palettes = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.