Using the Ganttifry package: save time and keep your sanity intact
Make sure you have R and RStudio installed on your computer.
To install the development version of the package directly from GitHub, run the following command (in your r console):
library(tidyverse) # for data manipulation, visualization, and analysis
library(ganttrify) # the package of interest here, to create Gantt charts
library(ggplot2) # for data visualization, you need it because your gantt chart will be a ggplot2 object
library(MetBrewer) # to have beautiful color palettes for your data visualizations
The MetBrewer package is a tool for adding visually stunning color palettes to your projects. Inspired by art.
Install the package from CRAN or GitHub:
To use the ganttrify package, you first need to create a data frame that defines the structure of your Gantt chart. This table should include the following columns:
Here is an example of how to create such df using tibble:
CBD_chart <- tibble::tribble(
~wp, ~activity, ~start_date, ~end_date,
"WP1 - Admin", "First admin activity", 1, 2,
"WP1 - Admin", "Another admin activity", 2, 6,
"WP1 - Admin", "Last admin activity", 18, 24,
"WP2 - Science", "Task development", 1, 3,
"WP2 - Science", "Data acquisition", 3, 4,
"WP2 - Science", "Data analysis", 3, 8,
"WP2 - Science", "Paper writing", 6, 10,
"WP2 - Science", "Task 2", 8, 12,
"WP2 - Science", "Task 3", 11, 22,
"WP3 - Dissemination", "International conferences", 4, 24,
"WP3 - Dissemination", "Local events", 1, 24,
"WP3 - Dissemination", "Workshop organization", 12, 24
)
Spots in ganttrify
allow you to mark key milestones or important events in your project timeline. Each spot is defined by:
CBD_spots <- tibble::tribble(
~activity, ~spot_type, ~spot_date,
# here are the letters I am using:
# M: milestones
# D: deliverables
# IC: international conferences
# W: workshops
# C : local events
# you can choose yours, even a full word/sentence
"First admin activity", "M", 2,
"Another admin activity", "M", 6,
"Last admin activity", "D", 24,
"Data acquisition", "M", 4,
"Data analysis", "M", 5,
"Data analysis", "M", 7,
"International conferences", "IC", 6,
"International conferences", "IC", 12,
"International conferences", "IC", 23,
"Local events", "C", 16,
"Workshop organization", "W", 14,
"Workshop organization", "W", 24
)
# use the function ganttrify to create your gantt chart (as a ggplot2 object)
ganttrify::ganttrify(
project = CBD_chart, # load your df that contain the gantt structure
spots = CBD_spots, # load the df defining your key events ('spots')
project_start_date = "2025-07", # put here the start date of your project
font_family = "sans",
size_text_relative = 1.4, # relative size of the text (default=1)
mark_quarters = TRUE, # defaults to FALSE.
# If TRUE, vertical lines are added in correspondence of change of quarter
# (end of March, end of June, end of September, end of December).
# you can also use mark_years=TRUEto add vertical lines at the end of each year
alpha_wp = 0.9, # transparency level for your WP bars (1: opaque)
alpha_activity = 0.6, # transparency level for actitivy bars
line_end_wp = "round", # shape of the line ends for WPs (alternatives: "butt" or "square" or "round")
line_end_activity = "round", # shape of line ends for actitivies
spot_size_text_relative = 1.5, # text size of the 'spots' labels
spot_fill = ggplot2::alpha(c("white"), 0.7), # background color and transparency for the spots
spot_padding = ggplot2::unit(0.4, "lines"), # padding around the text in the spot
colour_palette = MetBrewer::met.brewer("Cross", n=3, type = c("discrete")) # use the metbrewer palette [n=number of desired colors ; type either discrte or continuous, play with it :) ]
)
Refer to the documentation to see all the parckage arguments (type ??ganttrify
in your r console).
ganttrify
? β¨Microsoft Excel/Power point/Word (please donβt do that)
CBD Team meeting - 2025/01/28