Learn R Programming

ganttrify (version 0.0.0.9007)

ganttrify: Create Gantt charts from a data frame

Description

Creates Gantt charts with ggplot2.

Usage

ganttrify(
  project,
  spots = NULL,
  by_date = FALSE,
  exact_date = FALSE,
  project_start_date = Sys.Date(),
  colour_palette = wesanderson::wes_palette("Darjeeling1"),
  font_family = "sans",
  mark_quarters = FALSE,
  mark_years = FALSE,
  size_wp = 6,
  hide_wp = FALSE,
  size_activity = 4,
  size_text_relative = 1,
  month_number_label = TRUE,
  month_date_label = TRUE,
  x_axis_position = "top",
  colour_stripe = "lightgray",
  alpha_wp = 1,
  alpha_activity = 1,
  line_end = "round",
  month_breaks = 1,
  show_vertical_lines = TRUE,
  axis_text_align = "right"
)

Arguments

project

A data frame. See `ganttrify::test_project` for an example.

spots

A data frame. See `ganttrify::test_spots` for an example.

by_date

Logical, defaults to FALSE If FALSE, the the start and end columns in the data frame should correspond to month numbers from the beginning of the project. If TRUE, dates in the format ("2020-10" or "2020-10-01") should be given.

exact_date

Logical, defaults to FALSE. If FALSE, then periods are always understood to include full months. If FALSE, then exact dates can be given.

project_start_date

The date when the project starts. It can be a date, or a string in the format "2020-03" or "2020-03-01". Ignored if `month_number_date` is set to FALSE.

colour_palette

A character vector of colours or a colour palette.

font_family

A character vector of length 1, defaults to "sans". It is recommended to use a narrow/condensed font such as Roboto Condensed for more efficient use of text space.

mark_quarters

Logical, 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).

mark_years

Logical, defaults to FALSE. If TRUE, vertical lines are added in correspondence of change of year (1 January).

size_wp

Numeric, defaults to 6. It defines the thickness of the line used to represent WPs.

hide_wp

Logical, defaults to FALSE. If TRUE, the lines of the WP are hidden and only activities are shown.

size_activity

Numeric, defaults to 4. It defines the thickness of the line used to represent activities.

size_text_relative

Numeric, defaults to 1. Changes the size of all textual elements relative to their default size. If you set this to e.g. 1.5 all text elements will be 50% bigger.

month_number_label

Logical, defaults to TRUE. If TRUE, it includes month numbering on x axis.

month_date_label

Logical, defaults to TRUE. If TRUE, it includes month names and dates on the x axis.

x_axis_position

Logical, defaults to "top". Can also be "bottom". Used only when only one of `month_number_label` and `month_date_label` is TRUE, otherwise ignored.

colour_stripe

Character, defaults to "lightgray". This is the stripe colour in the background used in alternate months.

alpha_wp

Numeric, defaults to 1. Controls transparency of the line used to represent WPs.

alpha_activity

Numeric, defaults to 1. Controls transparency of the line used to represent activities.

line_end

Character, defaults to "round". One of "round", "butt", "square". Controls line ends.

month_breaks

Numeric, defaults to 1. It defines if labels for all months are shown or only once every x months. Useful for longer projects.

show_vertical_lines

Logical, defaults to TRUE. If set to FALSE, it hides the thin vertical lines corresponding to month numbers. Useful in particular for longer projects.

axis_text_align

Character, defaults to "right". Defines alignment of text on the y-axis is left. Accepted values are "left", "right", "centre", or "center".

Value

A Gantt chart as a ggplot2 object.

Examples

Run this code
# NOT RUN {
ganttrify(ganttrify::test_project)

# }

Run the code above in your browser using DataLab