MyNixOS website logo
Description

Conesa Colors Palette.

Provides a collection of palettes designed to integrate with 'ggplot', reflecting the color schemes associated with 'ConesaLab'.

RColorConesa

Installation

You can install the released version of RColorConesa from GitHub with:

# install.packages("devtools")
devtools::install_github("ConesaLab/RColorConesa")

Information

The package RColorConesa is a color packages with different palletes inspired by the corporative image of the Conesa Lab.

Palettes

RColorConesa consists of seven main colours from which a number of different colour palettes have been created. Each palette have the continuous and the continuous form as you can see in next examples.

Palette - main

#> Warning: `qplot()` was deprecated in ggplot2 3.4.0.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.

Palette - nature

Palette - sunshine

Palette - hot

Palette - warm

Palette - cold

Palette - complete

Example - plot()

This is a basic example which shows you how to solve a common problem using the databases “iris” and the basic ploting function in R. The objetive is color by spsecie using the RcolorConesa packages.

To do this, we can use the funtion “colorConesa()” which returns a list of as many colors of you needed.

library(RColorConesa)

n_species <- length(levels(iris$Species))
colorSpecies <- colorConesa(n_species, palette = "main")

plot(x = iris$Sepal.Length, y = iris$Sepal.Width, col = colorSpecies[iris$Species], pch = 16)
legend("bottomleft", legend=c(levels(iris$Species)), col=colorSpecies, lty=1)

Example - ggplot()

In case of ggplot(), if we want to plot by color it is much more easier to do with the functions “scale_color_conesa()” and “scale_fill_conesa()”. We plot the same result we made before.

library(RColorConesa)
library(ggplot2)

ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
  geom_point(size = 4) +
  scale_color_conesa(palette = "main")

A good point for the packages is you can use more colors that it already have. For example, we are going to color each Manufacturer from the dataset “mpg” from the package “ggplot2”.

As you can see, the palette “complete” only have 7 colors, but it can interpolate as much as need it to fill all the categories.

library(RColorConesa)
library(ggplot2)

mpg <- ggplot2::mpg

ggplot(mpg, aes(manufacturer, fill = manufacturer)) +
  geom_bar() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
  scale_fill_conesa(palette = "complete")

Finally, for continuous variables, you can change the parameter continuous to True in the functions “scale_fill_conesa()” and “scale_fill_conesa()”.

library(RColorConesa)
library(ggplot2)

df.heatmap <- expand.grid(Var1 = letters[1:15], Var2 = 1:15)
df.heatmap$score <- runif(nrow(df.heatmap), min = -5, max = 5)

ggplot(df.heatmap, aes(x = Var1, y = Var2, fill = score)) + 
  geom_tile() + 
  scale_fill_conesa(palette = "sunshine", continuous = T)

Contact

Note that RColorConesa can be updated. If you encounter a problem, please open an issue via GitHub or send an email to [email protected].

Author

Pedro Salguero García - [email protected].

Metadata

Version

1.0.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows