| Title: | EKIO Visual Identity System for R Data Visualization |
|---|---|
| Description: | A ggplot2 implementation of EKIO's visual identity for data visualization. Professional themes, curated color palettes, and scale functions for ggplot2 and gt tables. Includes high-level recipe functions for common chart types. |
| Authors: | Vinicius Oike [aut, cre, cph] (ORCID: <https://orcid.org/0009-0005-8015-9189>) |
| Maintainer: | Vinicius Oike <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.4.0 |
| Built: | 2026-06-19 23:07:39 UTC |
| Source: | https://github.com/viniciusoike/ekioplot |
A comprehensive dataset containing agricultural production data for Brazil's three major crops by municipality, based on IBGE's Municipal Agricultural Production survey (PAM - Produção Agrícola Municipal).
brazil_agriculturebrazil_agriculture
A tibble with 16,689 rows and 12 variables:
IBGE municipality code (numeric)
Municipality name (character)
State name (character)
Region name in Portuguese (character)
Crop name in English (character)
Production quantity in tonnes (numeric)
Area harvested in hectares (numeric)
Calculated productivity in tonnes per hectare (numeric)
Crop cultivation type: annual, semi-perennial (character)
Crop category: grains, industrial (character)
Economic importance: major (character)
Production scale category (integer)
The dataset covers Brazil's three major crops by municipality in 2022: soybeans, corn, and sugarcane. This represents municipal-level agricultural production data for analysis of regional agricultural patterns.
Crops included:
Soybeans: Brazil's top agricultural export (annual grain crop)
Corn: Major grain crop for domestic and export markets (annual)
Sugarcane: Industrial crop for sugar and ethanol (semi-perennial)
Geographic coverage: All Brazilian municipalities with production data for these crops across all regions.
IBGE - Instituto Brasileiro de Geografia e Estatística Table 1612: Area, production, yield and value of agricultural production (PAM - Produção Agrícola Municipal) https://www.ibge.gov.br/
IBGE. (2023). Produção Agrícola Municipal - PAM 2022. Rio de Janeiro: IBGE.
## Not run: # Load the dataset data(brazil_agriculture) # View top soybean producing municipalities brazil_agriculture |> filter(crop == "soybeans") |> slice_max(production_tonnes, n = 10) # Check available crops unique(brazil_agriculture$crop) # View structure str(brazil_agriculture) ## End(Not run)## Not run: # Load the dataset data(brazil_agriculture) # View top soybean producing municipalities brazil_agriculture |> filter(crop == "soybeans") |> slice_max(production_tonnes, n = 10) # Check available crops unique(brazil_agriculture$crop) # View structure str(brazil_agriculture) ## End(Not run)
A time series dataset containing agricultural production data for Brazil's major crops by state, based on IBGE's Municipal Agricultural Production survey (PAM).
brazil_agriculture_statesbrazil_agriculture_states
A tibble with 9,450 rows and 8 variables:
IBGE state code (numeric)
State name (character)
Year of observation (1974-2023, numeric)
Crop name in English (character)
Production quantity in tonnes (numeric)
Area harvested in hectares (numeric)
Productivity in kg per hectare (numeric)
Production value in thousands of BRL (numeric)
This dataset provides state-level time series for Brazil's seven most important crops from 1974 to 2023, enabling analysis of long-term agricultural trends and regional specialization patterns.
Crops included:
Soybeans: Brazil's top agricultural export
Corn: Major grain crop for domestic and export markets
Sugarcane: Industrial crop for sugar and ethanol
Cotton: Key fiber crop and export commodity
Rice: Important food security crop
Wheat: Food grain crop, mainly in southern states
Beans: Traditional protein source and food security crop
Time coverage: Nearly 50 years of data (1974-2023) providing comprehensive historical perspective on Brazilian agricultural development.
IBGE - Instituto Brasileiro de Geografia e Estatística Table 1612: Area, production, yield and value of agricultural production (PAM - Produção Agrícola Municipal) https://www.ibge.gov.br/
IBGE. (2023). Produção Agrícola Municipal - PAM 2022. Rio de Janeiro: IBGE.
## Not run: # Load the dataset data(brazil_agriculture_states) # Soybean production trends by top states (recent years) brazil_agriculture_states |> filter(crop == "soybeans", year >= 2010, !is.na(production_tonnes)) |> slice_max(production_tonnes, n = 50) |> ggplot(aes(year, production_tonnes, color = name_state)) + geom_line() # View structure str(brazil_agriculture_states) ## End(Not run)## Not run: # Load the dataset data(brazil_agriculture_states) # Soybean production trends by top states (recent years) brazil_agriculture_states |> filter(crop == "soybeans", year >= 2010, !is.na(production_tonnes)) |> slice_max(production_tonnes, n = 50) |> ggplot(aes(year, production_tonnes, color = name_state)) + geom_line() # View structure str(brazil_agriculture_states) ## End(Not run)
A dataset containing municipal GDP data for all Brazilian municipalities based on IBGE's Municipal National Accounts (Contas Nacionais Municipais).
brazil_gdpbrazil_gdp
A tibble with 5,570 rows and 7 variables:
IBGE municipality code (numeric)
Municipality name (character)
IBGE state code (numeric)
State name (character)
Year of observation (2021, numeric)
GDP in thousands of Brazilian reais (numeric)
GDP in millions of Brazilian reais (numeric)
The dataset includes GDP data for all 5,570 Brazilian municipalities for 2021, the most recent year available in IBGE's Municipal National Accounts. GDP values are provided in both thousands (gdp_brl_k) and millions (gdp_brl_m) of Brazilian reais at current prices.
IBGE - Instituto Brasileiro de Geografia e Estatística Table 5938: GDP and other aggregates by municipality (Contas Nacionais Municipais) https://www.ibge.gov.br/
IBGE. (2023). Produto Interno Bruto dos Municípios - 2021. Rio de Janeiro: IBGE.
## Not run: # Load the dataset data(brazil_gdp) # Top 10 municipalities by GDP in 2021 brazil_gdp |> slice_max(gdp_brl_m, n = 10) # View structure str(brazil_gdp) ## End(Not run)## Not run: # Load the dataset data(brazil_gdp) # Top 10 municipalities by GDP in 2021 brazil_gdp |> slice_max(gdp_brl_m, n = 10) # View structure str(brazil_gdp) ## End(Not run)
A dataset containing population data for Brazilian municipalities with over 100,000 inhabitants, based on IBGE population estimates for 2025.
brazil_populationbrazil_population
A tibble with 338 rows and 5 variables:
Population ranking among all municipalities (numeric)
Municipality name (character)
State abbreviation (character)
Total population in 2025 (numeric)
City size category based on population (ordered factor)
The dataset focuses on Brazil's 338 largest municipalities (population > 100,000) and provides population ranking and size classification for 2025.
City size categories:
Metropolis (1M+): 1 million+ inhabitants
Large city (500K-1M): 500,000 to 1 million inhabitants
Medium city (200K-500K): 200,000 to 500,000 inhabitants
Small city (100K-200K): 100,000 to 200,000 inhabitants
IBGE - Instituto Brasileiro de Geografia e Estatística Table 6579: Municipal population estimates https://www.ibge.gov.br/
## Not run: # Load the dataset data(brazil_population) # View the largest cities head(brazil_population) # Count cities by category table(brazil_population$category) ## End(Not run)## Not run: # Load the dataset data(brazil_population) # View the largest cities head(brazil_population) # Count cities by category table(brazil_population$category) ## End(Not run)
Individual accent colors for quick access.
ekio_accentekio_accent
Named character vector with 8 accent colors
ekio_accent["blue"] # Primary blue ekio_accent["orange"] # Contrast accentekio_accent["blue"] # Primary blue ekio_accent["orange"] # Contrast accent
Professional area plot with smart aesthetic detection. Supports stacked and filled (proportional) area charts.
ekio_areaplot( data, x, y, fill = NULL, palette = NULL, position = "stack", alpha = 0.8, add_zero = TRUE, ... )ekio_areaplot( data, x, y, fill = NULL, palette = NULL, position = "stack", alpha = 0.8, add_zero = TRUE, ... )
data |
A data frame |
x |
X-axis variable (supports data-masking) |
y |
Y-axis variable (supports data-masking) |
fill |
Fill aesthetic. A color string or variable name. |
palette |
Character. Palette name for variable mappings. |
position |
Character. Stacking method: |
alpha |
Numeric. Fill transparency (default: 0.8). |
add_zero |
Logical. Add horizontal line at y=0 (default: TRUE). |
... |
Additional arguments passed to |
ggplot2 object
ekio_areaplot(ggplot2::economics, date, unemploy) # Stacked area with groups data(fuels) world_fuels <- fuels[fuels$entity == "World" & fuels$year >= 1950, ] ekio_areaplot(world_fuels, year, consumption_gwh, fill = fuel)ekio_areaplot(ggplot2::economics, date, unemploy) # Stacked area with groups data(fuels) world_fuels <- fuels[fuels$entity == "World" & fuels$year >= 1950, ] ekio_areaplot(world_fuels, year, consumption_gwh, fill = fuel)
Professional bar plot with smart aesthetic detection.
ekio_barplot( data, x, y, fill = NULL, palette = NULL, add_zero = TRUE, horizontal = FALSE, bar_width = 0.8, ... )ekio_barplot( data, x, y, fill = NULL, palette = NULL, add_zero = TRUE, horizontal = FALSE, bar_width = 0.8, ... )
data |
A data frame |
x |
X-axis variable (supports data-masking) |
y |
Y-axis variable (supports data-masking) |
fill |
Fill aesthetic. A color string or variable name. |
palette |
Character. Palette name for variable mappings. |
add_zero |
Logical. Add horizontal line at y=0 (default: TRUE) |
horizontal |
Logical. Create horizontal bar plot (default: FALSE) |
bar_width |
Bar width (default: 0.8) |
... |
Additional arguments passed to |
ggplot2 object
cyl_counts <- as.data.frame(table(cyl = mtcars$cyl)) names(cyl_counts)[2] <- "n" ekio_barplot(cyl_counts, cyl, n)cyl_counts <- as.data.frame(table(cyl = mtcars$cyl)) names(cyl_counts)[2] <- "n" ekio_barplot(cyl_counts, cyl, n)
Brand identity color scale from light to dark.
ekio_blueekio_blue
Named character vector with 10 shades (50-900)
ekio_blue["700"] # Primary brand blue ekio_blue["200"] # Light blue for backgroundsekio_blue["700"] # Primary brand blue ekio_blue["200"] # Light blue for backgrounds
Neutral grays for text, backgrounds, borders, and grids.
ekio_grayekio_gray
Named character vector with 10 shades (50-900)
ekio_gray["900"] # Darkest text ekio_gray["300"] # Grid linesekio_gray["900"] # Darkest text ekio_gray["300"] # Grid lines
Professional histogram with smart aesthetic detection.
ekio_histogram( data, x, fill = NULL, palette = NULL, bins = "sturges", binwidth = NULL, add_zero = TRUE, border_color = "white", ... )ekio_histogram( data, x, fill = NULL, palette = NULL, bins = "sturges", binwidth = NULL, add_zero = TRUE, border_color = "white", ... )
data |
A data frame |
x |
Variable to plot (supports data-masking) |
fill |
Fill aesthetic. A color string or variable name. NULL uses EKIO blue. |
palette |
Character. Palette name for variable mappings. |
bins |
Binning method: "sturges", "FD", "scott", or numeric. |
binwidth |
Width of bins (overrides bins if specified) |
add_zero |
Logical. Add horizontal line at y=0 (default: TRUE) |
border_color |
Color for histogram outline (default: "white") |
... |
Additional arguments passed to |
ggplot2 object
ekio_histogram(mtcars, mpg) ekio_histogram(mtcars, mpg, fill = "steelblue") ekio_histogram(mtcars, mpg, fill = factor(cyl), palette = "cool")ekio_histogram(mtcars, mpg) ekio_histogram(mtcars, mpg, fill = "steelblue") ekio_histogram(mtcars, mpg, fill = factor(cyl), palette = "cool")
Professional line plot with smart aesthetic detection.
ekio_lineplot( data, x, y, color = NULL, palette = NULL, add_zero = TRUE, line_width = 0.8, ... )ekio_lineplot( data, x, y, color = NULL, palette = NULL, add_zero = TRUE, line_width = 0.8, ... )
data |
A data frame |
x |
X-axis variable (supports data-masking) |
y |
Y-axis variable (supports data-masking) |
color |
Color aesthetic. A color string or variable name. |
palette |
Character. Palette name for variable mappings. |
add_zero |
Logical. Add horizontal line at y=0 (default: TRUE) |
line_width |
Line thickness (default: 0.8) |
... |
Additional arguments passed to |
ggplot2 object
ekio_lineplot(ggplot2::economics, date, unemploy)ekio_lineplot(ggplot2::economics, date, unemploy)
Accent color for highlights, warnings, and contrast against blue.
ekio_orangeekio_orange
Named character vector with 10 shades (50-900)
ekio_orange["600"] # Primary orange accent ekio_orange["300"] # Soft orange for fillsekio_orange["600"] # Primary orange accent ekio_orange["300"] # Soft orange for fills
Returns colors for data visualization. Includes EKIO brand palettes, curated small-group variants, and standard scientific palettes.
ekio_pal(palette = "contrast", n = NULL, reverse = FALSE)ekio_pal(palette = "contrast", n = NULL, reverse = FALSE)
palette |
Character. Name of the palette. See |
n |
Integer or NULL. Number of colors to return. If NULL, returns all. |
reverse |
Logical. If TRUE, reverses the palette order. |
Character vector of hex color codes
ekio_pal("contrast") ekio_pal("contrast", n = 4) ekio_pal("binary", reverse = TRUE) ekio_pal("okabe_ito")ekio_pal("contrast") ekio_pal("contrast", n = 4) ekio_pal("binary", reverse = TRUE) ekio_pal("okabe_ito")
Professional scatter plot with smart aesthetic detection.
ekio_scatterplot( data, x, y, color = NULL, size = NULL, palette = NULL, add_zero = TRUE, add_smooth = FALSE, smooth_method = "lm", point_size = 2.5, point_alpha = 0.8, ... )ekio_scatterplot( data, x, y, color = NULL, size = NULL, palette = NULL, add_zero = TRUE, add_smooth = FALSE, smooth_method = "lm", point_size = 2.5, point_alpha = 0.8, ... )
data |
A data frame |
x |
X-axis variable (supports data-masking) |
y |
Y-axis variable (supports data-masking) |
color |
Color aesthetic. A color string or variable name. |
size |
Size aesthetic (optional variable) |
palette |
Character. Palette name for variable mappings. |
add_zero |
Logical. Add horizontal line at y=0 (default: TRUE) |
add_smooth |
Logical. Add smooth trend line (default: FALSE) |
smooth_method |
Smoothing method: "lm", "gam", "loess" (default: "lm") |
point_size |
Base point size (default: 2.5) |
point_alpha |
Point transparency (default: 0.8) |
... |
Additional arguments passed to |
ggplot2 object
ekio_scatterplot(mtcars, wt, mpg) ekio_scatterplot(mtcars, wt, mpg, color = factor(cyl))ekio_scatterplot(mtcars, wt, mpg) ekio_scatterplot(mtcars, wt, mpg, color = factor(cyl))
Secondary brand color for complementary use.
ekio_tealekio_teal
Named character vector with 10 shades (50-900)
ekio_teal["700"] # Strong teal ekio_teal["300"] # Light teal accentekio_teal["700"] # Strong teal ekio_teal["300"] # Light teal accent
Historical primary energy consumption data by fuel type and entity, spanning from 1800 to the present.
fuelsfuels
A tibble with 4 variables:
Country, region, or aggregated group name (character)
Year of observation (numeric)
Fuel type: "gas", "oil", or "coal" (character)
Primary energy consumption in gigawatt-hours (numeric)
Our World in Data — Energy https://ourworldindata.org/energy
## Not run: data(fuels) # Global consumption over time by fuel type fuels |> dplyr::filter(entity == "World") |> ggplot2::ggplot(ggplot2::aes(year, consumption_gwh, color = fuel)) + ggplot2::geom_line() ## End(Not run)## Not run: data(fuels) # Global consumption over time by fuel type fuels |> dplyr::filter(entity == "World") |> ggplot2::ggplot(ggplot2::aes(year, consumption_gwh, color = fuel)) + ggplot2::geom_line() ## End(Not run)
Professional EKIO branding and styling for gt table objects.
gt_theme_ekio( data, table_width = "100%", font_size = 14, stripe = TRUE, add_footer = TRUE )gt_theme_ekio( data, table_width = "100%", font_size = 14, stripe = TRUE, add_footer = TRUE )
data |
A gt table object |
table_width |
Character. Width of the table (default: "100%") |
font_size |
Numeric. Base font size in pixels (default: 14) |
stripe |
Logical. Apply alternating row striping (default: TRUE) |
add_footer |
Logical. Add automatic EKIO footer (default: TRUE) |
A styled gt table object
## Not run: library(gt) head(mtcars, 10) |> gt() |> gt_theme_ekio() ## End(Not run)## Not run: library(gt) head(mtcars, 10) |> gt() |> gt_theme_ekio() ## End(Not run)
A dataset containing the Social Progress Index rankings for the top 25 most populated Brazilian municipalities in 2025. The IPS Brasil is a comprehensive index that measures social and environmental progress across all 5,570 Brazilian municipalities using 57 indicators.
ips_brasilips_brasil
A data frame with 200 rows (25 municipalities x 8 measures) and 8 variables:
IBGE municipality code (numeric)
Municipality name (character)
State abbreviation (character)
Population in 2022 (numeric)
Indicator measured, one of 8 key social progress indicators (factor)
Ranking position among the 25 municipalities for each measure (1-25, numeric)
Municipality name if it's one of the 7 highlighted cities, empty string otherwise (character)
Factor indicating if municipality is highlighted (0 or 1)
Formatted rank labels showing only positions 1, 5, 10, 15, 20, 25 with ordinal suffix (character)
The dataset focuses on the 25 most populated Brazilian municipalities and includes rankings across 8 key social progress indicators:
Indicators included:
Social Progress Index: Overall composite score
GDP per capita: Economic indicator (2021 data)
Water and Sanitation: Access to basic services
Housing Conditions: Quality of housing infrastructure
Safety: Personal security measures
Healthcare and Wellbeing: Health system performance
Avg. ENEM scores: Educational outcomes (national exam)
Share College Educ.: Percentage of population with higher education
Highlighted municipalities (7 cities with special focus): The dataset highlights 7 specific municipalities for comparison purposes: Sao Paulo (SP), Brasilia (DF), Rio de Janeiro (RJ), Belem (PA), Porto Alegre (RS), Fortaleza (CE), and Recife (PE).
Data transformation: Rankings are calculated where rank 1 = best performance and rank 25 = worst performance among the top 25 most populated cities. The data is in long format with one row per municipality-indicator combination.
IPS Brasil 2025 - Indice de Progresso Social Brasil https://ipsbrasil.org.br/pt
The IPS Brasil is developed by Instituto Imazon and follows the methodology of the Social Progress Imperative, using 57 indicators across three dimensions: Basic Human Needs, Foundations of Wellbeing, and Opportunity.
Imazon. (2025). Indice de Progresso Social Brasil 2025. https://imazon.org.br/indice_de_progresso_social_brasil_2025/
## Not run: # Load the dataset data(ips_brasil) # View structure str(ips_brasil) ## End(Not run)## Not run: # Load the dataset data(ips_brasil) # View structure str(ips_brasil) ## End(Not run)
Returns names of all available palettes, optionally filtered by type.
list_ekio_palettes(type = "all")list_ekio_palettes(type = "all")
type |
Character. Type of palettes to list: "categorical", "small_group", "scientific", "sequential", "diverging", or "all" (default). |
Character vector of palette names, or named list if type = "all"
list_ekio_palettes() list_ekio_palettes("categorical") list_ekio_palettes("diverging")list_ekio_palettes() list_ekio_palettes("categorical") list_ekio_palettes("diverging")
Apply sequential or diverging palettes to continuous/numeric data.
scale_color_ekio_c(palette = "blue", reverse = FALSE, ...) scale_colour_ekio_c(palette = "blue", reverse = FALSE, ...) scale_fill_ekio_c(palette = "blue", reverse = FALSE, ...)scale_color_ekio_c(palette = "blue", reverse = FALSE, ...) scale_colour_ekio_c(palette = "blue", reverse = FALSE, ...) scale_fill_ekio_c(palette = "blue", reverse = FALSE, ...)
palette |
Character. Palette name (default: "blue").
See |
reverse |
Logical. If TRUE, reverses the color order. |
... |
Additional arguments passed to |
A ggplot2 scale object
scale_fill_ekio_c(), list_ekio_palettes()
library(ggplot2) ggplot(mtcars, aes(wt, mpg, color = hp)) + geom_point(size = 3) + scale_color_ekio_c() ggplot(mtcars, aes(wt, mpg, color = hp)) + geom_point(size = 3) + scale_color_ekio_c("purple")library(ggplot2) ggplot(mtcars, aes(wt, mpg, color = hp)) + geom_point(size = 3) + scale_color_ekio_c() ggplot(mtcars, aes(wt, mpg, color = hp)) + geom_point(size = 3) + scale_color_ekio_c("purple")
Apply qualitative palettes to discrete/categorical data.
scale_color_ekio_d(palette = "contrast", reverse = FALSE, ...) scale_colour_ekio_d(palette = "contrast", reverse = FALSE, ...) scale_fill_ekio_d(palette = "contrast", reverse = FALSE, ...)scale_color_ekio_d(palette = "contrast", reverse = FALSE, ...) scale_colour_ekio_d(palette = "contrast", reverse = FALSE, ...) scale_fill_ekio_d(palette = "contrast", reverse = FALSE, ...)
palette |
Character. Palette name (default: "contrast").
See |
reverse |
Logical. If TRUE, reverses the palette order. |
... |
Additional arguments passed to |
A ggplot2 scale object
ekio_pal(), scale_fill_ekio_d()
library(ggplot2) ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) + geom_point(size = 3) + scale_color_ekio_d()library(ggplot2) ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) + geom_point(size = 3) + scale_color_ekio_d()
Lists all available palettes organized by type.
show_all_ekio_palettes()show_all_ekio_palettes()
NULL (invisibly). Prints palette information to console.
show_all_ekio_palettes()show_all_ekio_palettes()
Visualizes a color palette as a horizontal bar chart with hex labels.
show_ekio_palette(palette, n = NULL, labels = TRUE)show_ekio_palette(palette, n = NULL, labels = TRUE)
palette |
Character or vector. Either a palette name or a vector of hex colors. |
n |
Integer. Number of colors (used for interpolation on sequential palettes). |
labels |
Logical. Show hex codes as labels (default: TRUE). |
A ggplot2 object (invisibly)
show_ekio_palette("contrast") show_ekio_palette(c("#1E3A5F", "#DD6B20", "#2C7A7B"))show_ekio_palette("contrast") show_ekio_palette(c("#1E3A5F", "#DD6B20", "#2C7A7B"))
A minimal, professional theme for EKIO visualizations built on
ggplot2::theme_minimal().
theme_ekio(base_size = 11, base_family = "", grid = "y")theme_ekio(base_size = 11, base_family = "", grid = "y")
base_size |
Numeric. Base font size in points (default: 11) |
base_family |
Character. Font family. Defaults to the platform-appropriate
EKIO font via |
grid |
Character. Which major grid lines to show: |
A ggplot2 theme object
A variant of theme_ekio() with axes and grid removed, suited for
choropleth and spatial maps.
theme_ekio_map(base_size = 11, base_family = "")theme_ekio_map(base_size = 11, base_family = "")
base_size |
Numeric. Base font size in points (default: 11) |
base_family |
Character. Font family. Defaults to the platform-appropriate
EKIO font via |
A ggplot2 theme object