Elevating Your Project: Branding using R

Learn how to craft a color palette, design a unique hex sticker logo, and generate a QR code for efficient GitHub access.
R
Author

Alex Reed

Published

August 18, 2023

Load Packages

show the code
library(hexSticker)
library(magick)
library(sysfonts)
library(qrcode)

A little bit about the project

My peers, Atahualpa Ayala, Dalila Lara, Guillermo Romero and I came up with the name PYFOREST as a team name for our capstone project: Informing Forest Conservation Regulations in Paraguay. ‘PY’ stands for Paraguay and that we would be using some Python in our analysis. ‘Forest’ underscores our focus on researching and conserving the Paraguayan Chaco, a diverse forest ecosystem.

Creating a cohesive color palette

In a collaborative effort, our team recognized the importance of maintaining visual coherence throughout our data visualizations. Since each team member was responsible for creating their own visualizations, we decided to establish a shared color palette. We used coolors.com to help us create our color palette.

show the code
library(ggplot2)

# Define the color palette
pyforest_palette <- c("#2f4858", "#a7c7d8", "#4B5F43", "#AEBD93", "#F6AE2D", "#F26419")
#Charcoal, Columbia Blue, Hunter Green, Sage, Hunyadi Yellow, Orange (Pantone)
palette_names <- c("Charcoal", "Columbia Blue", "Hunter Green", "Sage", "Hunyadi Yellow", "Orange (Pantone)")

# Create a data frame to store color names and values
palette_data <- data.frame(Color = factor(palette_names, levels = rev(palette_names)), Value = pyforest_palette)

# Create a ggplot bar plot displaying the colors
ggplot(palette_data, aes(x = Color, y = 1, fill = Value)) +
  geom_bar(stat = "identity") +
  scale_fill_identity() +
  theme_minimal() +
  labs(x = NULL, y = NULL, title = "PYFOREST Palette") +
  coord_flip() +
  theme(
    plot.title = element_text(hjust = 0.5, 
                              size = 16),
    axis.ticks = element_blank(),
    panel.grid.major.y = element_blank(),
    panel.grid.minor.y = element_blank(),
    panel.grid.major.x = element_blank(),
    panel.grid.minor.x = element_blank(),
    axis.text.y = element_text(size = 12),
    axis.text.x = element_blank(),
    panel.border = element_blank(),  # Remove panel border
    plot.background = element_rect(fill = '#FBFEF9', color = NA))

QR Code

To enhance our project’s accessibility, we created a QR code. By simply passing the relevant URL through the qr_code() function, we generated a QR code that provided easy access to our project’s GitHub repository. We embedded the QR code on the final slide of our presentation, allowing audience members to quickly delve deeper into our research.

show the code
url <- "https://github.com/cp-PYFOREST"
qr <- qr_code(url)
plot(qr)
show the code
# Save the qr code as a svg
generate_svg(qr, "filepath/qr.svg")

Informing Forest Conservation Regulations in Paraguay Presentation

Citation

BibTeX citation:
@online{reed2023,
  author = {Alex Reed},
  title = {Elevating {Your} {Project:} {Branding} Using {R}},
  date = {2023-08-18},
  url = {https://reedalexandria.github.io/2023-08-18-hex},
  langid = {en}
}
For attribution, please cite this work as:
Alex Reed. 2023. “Elevating Your Project: Branding Using R.” August 18, 2023. https://reedalexandria.github.io/2023-08-18-hex.