### Install viridisLite Development Version from GitHub Source: https://sjmgarnier.github.io/viridisLite/index.html Installs the devtools package if not already present, then installs the development version of viridisLite directly from its GitHub repository. This is useful for accessing the latest features or bug fixes. ```r if (!require(“devtools”)) install.packages(“devtools”) devtools::install_github(“sjmgarnier/viridisLite”) library(viridisLite) ``` -------------------------------- ### Displaying Viridis Palette with Image Source: https://sjmgarnier.github.io/viridisLite/reference/viridis.html Shows how to display a viridis color palette using the image function, adapted from RColorBrewer examples. This is useful for visualizing the color gradient. ```R n = 200 image( 1:n, 1, as.matrix(1:n), col = viridis(n, option = "D"), xlab = "viridis n", ylab = "", xaxt = "n", yaxt = "n", bty = "n" ) ``` -------------------------------- ### Install and Load viridisLite from CRAN Source: https://sjmgarnier.github.io/viridisLite/index.html Installs the viridisLite package from CRAN and loads it into the R session. This is the standard method for installing packages from the Comprehensive R Archive Network. ```r install.packages("viridisLite") library(viridisLite) ``` -------------------------------- ### plasma() Source: https://sjmgarnier.github.io/viridisLite/reference/index.html Generates the plasma color palette. ```APIDOC ## plasma() ### Description Generates the plasma color palette. ### Method Function Call ### Parameters None explicitly documented. ### Response Returns a color palette. ``` -------------------------------- ### turbo() Source: https://sjmgarnier.github.io/viridisLite/reference/index.html Generates the turbo color palette. ```APIDOC ## turbo() ### Description Generates the turbo color palette. ### Method Function Call ### Parameters None explicitly documented. ### Response Returns a color palette. ``` -------------------------------- ### inferno() Source: https://sjmgarnier.github.io/viridisLite/reference/index.html Generates the inferno color palette. ```APIDOC ## inferno() ### Description Generates the inferno color palette. ### Method Function Call ### Parameters None explicitly documented. ### Response Returns a color palette. ``` -------------------------------- ### mako() Source: https://sjmgarnier.github.io/viridisLite/reference/index.html Generates the mako color palette. ```APIDOC ## mako() ### Description Generates the mako color palette. ### Method Function Call ### Parameters None explicitly documented. ### Response Returns a color palette. ``` -------------------------------- ### magma() Source: https://sjmgarnier.github.io/viridisLite/reference/index.html Generates the magma color palette. ```APIDOC ## magma() ### Description Generates the magma color palette. ### Method Function Call ### Parameters None explicitly documented. ### Response Returns a color palette. ``` -------------------------------- ### cividis() Source: https://sjmgarnier.github.io/viridisLite/reference/index.html Generates the cividis color palette. ```APIDOC ## cividis() ### Description Generates the cividis color palette. ### Method Function Call ### Parameters None explicitly documented. ### Response Returns a color palette. ``` -------------------------------- ### rocket() Source: https://sjmgarnier.github.io/viridisLite/reference/index.html Generates the rocket color palette. ```APIDOC ## rocket() ### Description Generates the rocket color palette. ### Method Function Call ### Parameters None explicitly documented. ### Response Returns a color palette. ``` -------------------------------- ### viridis() Source: https://sjmgarnier.github.io/viridisLite/reference/index.html Generates the Viridis color palette. ```APIDOC ## viridis() ### Description Generates the Viridis color palette. ### Method Function Call ### Parameters None explicitly documented. ### Response Returns a color palette. ``` -------------------------------- ### ggplot2 Integration with Viridis Palette Source: https://sjmgarnier.github.io/viridisLite/reference/viridis.html Demonstrates how to use the viridis color palette with ggplot2 for creating visualizations. Requires the ggplot2 and hexbin packages. ```R library(ggplot2) library(hexbin) dat <- data.frame(x = rnorm(10000), y = rnorm(10000)) ggplot(dat, aes(x = x, y = y)) + geom_hex() + coord_fixed() + scale_fill_gradientn(colours = viridis(256, option = "D")) ``` -------------------------------- ### viridisMap() Source: https://sjmgarnier.github.io/viridisLite/reference/index.html Provides access to the Viridis color map data. ```APIDOC ## viridisMap() ### Description Provides access to the Viridis color map data. ### Method Function Call ### Parameters None explicitly documented. ### Response Returns color map data. ``` -------------------------------- ### cividis Source: https://sjmgarnier.github.io/viridisLite/reference/viridis.html Convenience function for the cividis color map. ```APIDOC ## cividis(n, alpha = 1, begin = 0, end = 1, direction = 1) ### Description Convenience function for the "cividis" color map option. ### Arguments - **n** (integer) - The number of colors (>=1) to be in the palette. - **alpha** (numeric) - The alpha transparency, a number in [0,1]. - **begin** (numeric) - The (corrected) hue in [0,1] at which the color map begins. - **end** (numeric) - The (corrected) hue in [0,1] at which the color map ends. - **direction** (numeric) - Sets the order of colors in the scale. If 1 (default), colors are ordered from darkest to lightest. If -1, the order of colors is reversed. ### Value Returns a character vector of color hex codes. ``` -------------------------------- ### turbo Source: https://sjmgarnier.github.io/viridisLite/reference/viridis.html Convenience function for the turbo color map. ```APIDOC ## turbo(n, alpha = 1, begin = 0, end = 1, direction = 1) ### Description Convenience function for the "turbo" color map option. ### Arguments - **n** (integer) - The number of colors (>=1) to be in the palette. - **alpha** (numeric) - The alpha transparency, a number in [0,1]. - **begin** (numeric) - The (corrected) hue in [0,1] at which the color map begins. - **end** (numeric) - The (corrected) hue in [0,1] at which the color map ends. - **direction** (numeric) - Sets the order of colors in the scale. If 1 (default), colors are ordered from darkest to lightest. If -1, the order of colors is reversed. ### Value Returns a character vector of color hex codes. ``` -------------------------------- ### plasma Source: https://sjmgarnier.github.io/viridisLite/reference/viridis.html Convenience function for the plasma color map. ```APIDOC ## plasma(n, alpha = 1, begin = 0, end = 1, direction = 1) ### Description Convenience function for the "plasma" color map option. ### Arguments - **n** (integer) - The number of colors (>=1) to be in the palette. - **alpha** (numeric) - The alpha transparency, a number in [0,1]. - **begin** (numeric) - The (corrected) hue in [0,1] at which the color map begins. - **end** (numeric) - The (corrected) hue in [0,1] at which the color map ends. - **direction** (numeric) - Sets the order of colors in the scale. If 1 (default), colors are ordered from darkest to lightest. If -1, the order of colors is reversed. ### Value Returns a character vector of color hex codes. ``` -------------------------------- ### magma Source: https://sjmgarnier.github.io/viridisLite/reference/viridis.html Convenience function for the magma color map. ```APIDOC ## magma(n, alpha = 1, begin = 0, end = 1, direction = 1) ### Description Convenience function for the "magma" color map option. ### Arguments - **n** (integer) - The number of colors (>=1) to be in the palette. - **alpha** (numeric) - The alpha transparency, a number in [0,1]. - **begin** (numeric) - The (corrected) hue in [0,1] at which the color map begins. - **end** (numeric) - The (corrected) hue in [0,1] at which the color map ends. - **direction** (numeric) - Sets the order of colors in the scale. If 1 (default), colors are ordered from darkest to lightest. If -1, the order of colors is reversed. ### Value Returns a character vector of color hex codes. ``` -------------------------------- ### inferno Source: https://sjmgarnier.github.io/viridisLite/reference/viridis.html Convenience function for the inferno color map. ```APIDOC ## inferno(n, alpha = 1, begin = 0, end = 1, direction = 1) ### Description Convenience function for the "inferno" color map option. ### Arguments - **n** (integer) - The number of colors (>=1) to be in the palette. - **alpha** (numeric) - The alpha transparency, a number in [0,1]. - **begin** (numeric) - The (corrected) hue in [0,1] at which the color map begins. - **end** (numeric) - The (corrected) hue in [0,1] at which the color map ends. - **direction** (numeric) - Sets the order of colors in the scale. If 1 (default), colors are ordered from darkest to lightest. If -1, the order of colors is reversed. ### Value Returns a character vector of color hex codes. ``` -------------------------------- ### Generate Viridis Color Palette Source: https://sjmgarnier.github.io/viridisLite/reference/viridis.html Generates a vector of n equally spaced colors along the selected color map. Use option="D" for the default viridis palette. ```R viridis(n, alpha = 1, begin = 0, end = 1, direction = 1, option = "D") ``` ```R viridisMap(n = 256, alpha = 1, begin = 0, end = 1, direction = 1, option = "D") ``` ```R magma(n, alpha = 1, begin = 0, end = 1, direction = 1) ``` ```R inferno(n, alpha = 1, begin = 0, end = 1, direction = 1) ``` ```R plasma(n, alpha = 1, begin = 0, end = 1, direction = 1) ``` ```R cividis(n, alpha = 1, begin = 0, end = 1, direction = 1) ``` ```R rocket(n, alpha = 1, begin = 0, end = 1, direction = 1) ``` ```R mako(n, alpha = 1, begin = 0, end = 1, direction = 1) ``` ```R turbo(n, alpha = 1, begin = 0, end = 1, direction = 1) ``` -------------------------------- ### viridis Source: https://sjmgarnier.github.io/viridisLite/reference/viridis.html Creates a vector of n equally spaced colors along the viridis color map. Supports various options for color map selection and customization. ```APIDOC ## viridis(n, alpha = 1, begin = 0, end = 1, direction = 1, option = "D") ### Description Creates a vector of `n` equally spaced colors along the selected color map. ### Arguments - **n** (integer) - The number of colors (>=1) to be in the palette. - **alpha** (numeric) - The alpha transparency, a number in [0,1]. - **begin** (numeric) - The (corrected) hue in [0,1] at which the color map begins. - **end** (numeric) - The (corrected) hue in [0,1] at which the color map ends. - **direction** (numeric) - Sets the order of colors in the scale. If 1 (default), colors are ordered from darkest to lightest. If -1, the order of colors is reversed. - **option** (character) - A character string indicating the color map option to use. Options include "magma" ("A"), "inferno" ("B"), "plasma" ("C"), "viridis" ("D"), "cividis" ("E"), "rocket" ("F"), "mako" ("G"), "turbo" ("H"). ### Value Returns a character vector of color hex codes. ``` -------------------------------- ### viridisMap Source: https://sjmgarnier.github.io/viridisLite/reference/viridis.html Generates a data frame containing the RGBA channels for n equally spaced colors along the selected color map. ```APIDOC ## viridisMap(n = 256, alpha = 1, begin = 0, end = 1, direction = 1, option = "D") ### Description Generates a data frame containing the red (R), green (G), blue (B) and alpha (alpha) channels of `n` equally spaced colors along the selected color map. ### Arguments - **n** (integer) - The number of colors (>=1) to be in the palette. Defaults to 256. - **alpha** (numeric) - The alpha transparency, a number in [0,1]. - **begin** (numeric) - The (corrected) hue in [0,1] at which the color map begins. - **end** (numeric) - The (corrected) hue in [0,1] at which the color map ends. - **direction** (numeric) - Sets the order of colors in the scale. If 1 (default), colors are ordered from darkest to lightest. If -1, the order of colors is reversed. - **option** (character) - A character string indicating the color map option to use. Options include "magma" ("A"), "inferno" ("B"), "plasma" ("C"), "viridis" ("D"), "cividis" ("E"), "rocket" ("F"), "mako" ("G"), "turbo" ("H"). ### Value Returns a `n` lines data frame containing the red (R), green (G), blue (B) and alpha (alpha) channels of `n` equally spaced colors along the selected color map. ``` -------------------------------- ### BibTeX Citation for viridisLite Source: https://sjmgarnier.github.io/viridisLite/authors.html Use this BibTeX entry to cite the viridisLite package in academic work. It includes author names, year, title, version, and relevant URLs/DOIs. ```bibtex @Manual{ title = {{viridis(Lite)} - Colorblind-Friendly Color Maps for R}, author = {{Garnier} and {Simon} and {Ross} and {Noam} and {Rudis} and {Robert} and {Camargo} and Antônio Pedro and {Sciaini} and {Marco} and {Scherer} and {Cédric}}, year = {2023}, note = {viridisLite package version 0.4.2}, url = {https://sjmgarnier.github.io/viridis/}, doi = {10.5281/zenodo.4678326}, } ``` -------------------------------- ### mako Source: https://sjmgarnier.github.io/viridisLite/reference/viridis.html Convenience function for the mako color map. ```APIDOC ## mako(n, alpha = 1, begin = 0, end = 1, direction = 1) ### Description Convenience function for the "mako" color map option. ### Arguments - **n** (integer) - The number of colors (>=1) to be in the palette. - **alpha** (numeric) - The alpha transparency, a number in [0,1]. - **begin** (numeric) - The (corrected) hue in [0,1] at which the color map begins. - **end** (numeric) - The (corrected) hue in [0,1] at which the color map ends. - **direction** (numeric) - Sets the order of colors in the scale. If 1 (default), colors are ordered from darkest to lightest. If -1, the order of colors is reversed. ### Value Returns a character vector of color hex codes. ``` -------------------------------- ### rocket Source: https://sjmgarnier.github.io/viridisLite/reference/viridis.html Convenience function for the rocket color map. ```APIDOC ## rocket(n, alpha = 1, begin = 0, end = 1, direction = 1) ### Description Convenience function for the "rocket" color map option. ### Arguments - **n** (integer) - The number of colors (>=1) to be in the palette. - **alpha** (numeric) - The alpha transparency, a number in [0,1]. - **begin** (numeric) - The (corrected) hue in [0,1] at which the color map begins. - **end** (numeric) - The (corrected) hue in [0,1] at which the color map ends. - **direction** (numeric) - Sets the order of colors in the scale. If 1 (default), colors are ordered from darkest to lightest. If -1, the order of colors is reversed. ### Value Returns a character vector of color hex codes. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.