| Title: | 2 Degrees Investing Colour Palettes in Different Formats |
|---|---|
| Description: | Get colour values from different colour palettes used by 2 Degrees Investing (2DII) organization in their reserach streams. Different ways to obtain the colour values are available: dataframe or a function call. |
| Authors: | Monika Furdyna [aut, ctr, cre] (ORCID: <https://orcid.org/0000-0002-3728-0646>) |
| Maintainer: | Monika Furdyna <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.0.9000 |
| Built: | 2026-05-24 07:22:12 UTC |
| Source: | https://github.com/rmi-pacta/r2dii.colours |
This vector contains names associated with different colours from 1 in 1000 palette.
colour_aliases_1in1000colour_aliases_1in1000
An object of class character of length 43.
colour_aliases_1in1000 colour_aliases_1in1000[c("high_carbon_exposure", "low_carbon_exposure")]colour_aliases_1in1000 colour_aliases_1in1000[c("high_carbon_exposure", "low_carbon_exposure")]
This vector contains names associated with different colours from 2DII palette.
colour_aliases_2diicolour_aliases_2dii
An object of class character of length 38.
colour_aliases_2dii colour_aliases_2dii[c("equity", "bonds")]colour_aliases_2dii colour_aliases_2dii[c("equity", "bonds")]
This vector contains named colours associated with PACTA sectors and technologies.
colour_aliases_pactacolour_aliases_pacta
An object of class character of length 67.
colour_aliases_pacta colour_aliases_pacta[c("ice", "hybrid", "electric")] colour_aliases_pacta[c("steel", "aviation", "cement")]colour_aliases_pacta colour_aliases_pacta[c("ice", "hybrid", "electric")] colour_aliases_pacta[c("steel", "aviation", "cement")]
This vector contains named colours associated with user survey results plots.
colour_aliases_surveycolour_aliases_survey
An object of class character of length 11.
colour_aliases_survey colour_aliases_survey[c("climate_strategy_concrete_goals")] colour_aliases_pacta[c("Concrete goals", "Climate strategy")]colour_aliases_survey colour_aliases_survey[c("climate_strategy_concrete_goals")] colour_aliases_pacta[c("Concrete goals", "Climate strategy")]
All datasets have at least two columns:
label: Text label of the colour.
hex: Hex code of the colour.
palette_1in1000_background palette_1in1000_goodbad palette_1in1000_plot palette_2dii_plot palette_2dii_scenario palette_2dii_sector palette_2dii_power palette_2dii_automotive palette_2dii_oil_gas palette_2dii_fossil_fuelspalette_1in1000_background palette_1in1000_goodbad palette_1in1000_plot palette_2dii_plot palette_2dii_scenario palette_2dii_sector palette_2dii_power palette_2dii_automotive palette_2dii_oil_gas palette_2dii_fossil_fuels
An object of class character of length 1.
An object of class tbl_df (inherits from tbl, data.frame) with 5 rows and 2 columns.
An object of class tbl_df (inherits from tbl, data.frame) with 10 rows and 2 columns.
An object of class tbl_df (inherits from tbl, data.frame) with 9 rows and 2 columns.
An object of class tbl_df (inherits from tbl, data.frame) with 5 rows and 2 columns.
An object of class tbl_df (inherits from tbl, data.frame) with 8 rows and 2 columns.
An object of class tbl_df (inherits from tbl, data.frame) with 6 rows and 2 columns.
An object of class tbl_df (inherits from tbl, data.frame) with 7 rows and 2 columns.
An object of class tbl_df (inherits from tbl, data.frame) with 2 rows and 2 columns.
An object of class tbl_df (inherits from tbl, data.frame) with 3 rows and 2 columns.
palette_1in1000_background palette_1in1000_goodbad palette_1in1000_plot palette_2dii_plot palette_2dii_scenario palette_2dii_sector palette_2dii_power palette_2dii_automotive palette_2dii_oil_gas palette_2dii_fossil_fuelspalette_1in1000_background palette_1in1000_goodbad palette_1in1000_plot palette_2dii_plot palette_2dii_scenario palette_2dii_sector palette_2dii_power palette_2dii_automotive palette_2dii_oil_gas palette_2dii_fossil_fuels
Retrieve colour hex values from a palette
get_colours( colour_names = "red", palette = r2dii.colours::palette_1in1000_plot )get_colours( colour_names = "red", palette = r2dii.colours::palette_1in1000_plot )
colour_names |
Character string or a vector of character strings with names of colours for which you want to retrieve the hex values. |
palette |
The dataframe from which the hex values are retrieved. It
should contain columns |
A vector of strings with hex codes in order specified by
colour_names.
# use default palette get_colours(c("red", "blue")) # specify which palette to use get_colours(c("red", "green"), palette = palette_1in1000_goodbad)# use default palette get_colours(c("red", "blue")) # specify which palette to use get_colours(c("red", "green"), palette = palette_1in1000_goodbad)
A custom discrete colour and fill scales with colours from 2DII palettes.
scale_colour_2dii( palette = c("2dii", "1in1000", "pacta", "survey"), colour_groups = NULL, labels = NULL, ... ) scale_fill_2dii( palette = c("2dii", "1in1000", "pacta", "survey"), colour_groups = NULL, labels = NULL, ... )scale_colour_2dii( palette = c("2dii", "1in1000", "pacta", "survey"), colour_groups = NULL, labels = NULL, ... ) scale_fill_2dii( palette = c("2dii", "1in1000", "pacta", "survey"), colour_groups = NULL, labels = NULL, ... )
palette |
String with the name of the colour scale to be used. If not specified then the general 2dii scale is used |
colour_groups |
A vector containing groups variable to which colours are
assigned. It is needed when the data assigned to |
labels |
Labels parameter to be used in |
... |
Other parameters passed on to |
An object of class "ScaleDiscrete".
library(ggplot2, warn.conflicts = FALSE) library(r2dii.plot, warn.conflicts = FALSE) library(dplyr, warn.conflicts = FALSE) sda %>% filter(emission_factor_metric == "projected") %>% ggplot() + geom_line(aes(x = year, y = emission_factor_value, colour = sector)) + scale_colour_2dii() mpg %>% ggplot() + geom_histogram(aes(cyl, fill = class), position = "dodge", bins = 5) + scale_fill_2dii() sda %>% filter(emission_factor_metric == "projected") %>% ggplot() + geom_line(aes(x = year, y = emission_factor_value, colour = sector)) + scale_colour_2dii(palette = "1in1000", colour_groups = sda$sector) market_share %>% filter(sector == "automotive", year %in% c(2020, 2025), metric == "projected") %>% ggplot() + geom_bar( stat = "identity", aes(x = year, y = technology_share, fill = technology) ) + scale_fill_2dii(palette = "pacta")library(ggplot2, warn.conflicts = FALSE) library(r2dii.plot, warn.conflicts = FALSE) library(dplyr, warn.conflicts = FALSE) sda %>% filter(emission_factor_metric == "projected") %>% ggplot() + geom_line(aes(x = year, y = emission_factor_value, colour = sector)) + scale_colour_2dii() mpg %>% ggplot() + geom_histogram(aes(cyl, fill = class), position = "dodge", bins = 5) + scale_fill_2dii() sda %>% filter(emission_factor_metric == "projected") %>% ggplot() + geom_line(aes(x = year, y = emission_factor_value, colour = sector)) + scale_colour_2dii(palette = "1in1000", colour_groups = sda$sector) market_share %>% filter(sector == "automotive", year %in% c(2020, 2025), metric == "projected") %>% ggplot() + geom_bar( stat = "identity", aes(x = year, y = technology_share, fill = technology) ) + scale_fill_2dii(palette = "pacta")