create_gantt.Rd
Generates a Gantt chart showing the schedule of pile-driving activities at selected wind farm sites.
create_gantt(
project,
spots = NULL,
by_date = FALSE,
exact_date = FALSE,
project_start_date = Sys.Date(),
project_end_date = Sys.Date() + 365,
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,
label_wrap = FALSE,
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"
)
A data.frame
object. See test_project for an example.
A data.frame
object. See test_spots for an example.
Logical. If FALSE
, 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. Defaults to FALSE
.
Logical. If FALSE
, then periods are always understood to include full months. If TRUE
, then exact dates can be given. Defaults to FALSE
.
The date when the project starts. Can be a date, or a string in the format "2020-03" or "2020-03-01".
The date when the project ends. Can be a date, or a string in the format "2020-03" or "2020-03-01".
A character vector of colours or a colour palette.
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.
Logical. If TRUE
, vertical lines are added in correspondence of change of quarter (end of March, end of June, end of September, end of December). Defaults to FALSE
.
Logical. If TRUE
, vertical lines are added in correspondence of change of year (1 January). Defaults to FALSE
.
Numeric. Defines the thickness of the line used to represent WPs. Defaults to 6
.
Logical. If TRUE
, the lines of the WP are hidden and only activities are shown. Defaults to FALSE
.
Numeric. It defines the thickness of the line used to represent activities. Defaults to 4
.
Numeric. Changes the size of all textual elements relative to their default size. For example, if set this to 1.5 all text elements will be 50% bigger. Defaults to 1
.
Logical. If given, must be numeric, referring to the number of characters per line allowed in the labels of projects and activities, or logical (if set to TRUE
, it will default to 32). To be used when labels would otherwise be excessively long. Defaults to FALSE
.
Logical. If TRUE
, month numbering is included on the x-axis. Defaults to TRUE
.
Logical. If TRUE
, month names and dates are included on the x-axis. Defaults to TRUE
.
Character. Defaults to "top". Can also be "bottom". Used only when one of 'month_number_label' and 'month_date_label' is TRUE
, otherwise ignored.
Character. Defaults to "lightgray". This is the stripe colour in the background used in alternate months.
Numeric. Controls transparency of the line used to represent WPs. Defaults to 1
.
Numeric. Controls transparency of the line used to represent activities. Defaults to 1
.
Character. Defaults to "round". One of "round", "butt", "square". Controls line ends.
Numeric. Defines if labels for all months are shown or only once every x months. Useful for longer projects. Defaults to 1
.
Logical. If set to FALSE
, it hides the thin vertical lines corresponding to month numbers. Useful in particular for longer projects. Defaults to TRUE
.
Character. Defaults to "right". Defines alignment of text on the y-axis is left. Accepted values are "left", "right", "centre", or "center".
A Gantt chart as a ggplot2 object.
Adapted from ganttrify.