plotGantt: Plot a Gantt chart using plotly

Description Usage Arguments Details Value Examples

View source: R/gantt.R

Description

A Gantt chart is plotted using plotly. The format of the data.frame given to the function should be Task Start Duration Resource Task 1 2016-01-01 50 A Task 2 2016-02-20 25 B Task 3 2016-01-01 100 C Task 4 2016-04-10 60 C Task 5 2016-06-09 30 C Task 6 2016-04-10 150 A Task 7 2016-09-07 80 B Task 8 2016-11-26 10 B where the duration is given in days.

Usage

1
plotGantt(mydf, client, brewerpalname = "Set3")

Arguments

mydf

the data.frame containing the information of the project

client

the client name given as a string

brewerpalname

the name of the palette to use from RColorBrewer which defaults to "Set3"

Details

Originally source appeared on https://www.r-bloggers.com/gantt-charts-in-r-using-plotly/.

Value

a plotly object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
tmpdf <- structure(list(
  Task = c(
    "Task 1", "Task 2", "Task 3", "Task 4",
    "Task 5", "Task 6", "Task 7", "Task 8"
  ), Start = structure(c(
    16801,
    16851, 16801, 16901, 16961, 16901, 17051, 17131
  ), class = "Date"),
  Duration = c(50L, 25L, 100L, 60L, 30L, 150L, 80L, 10L), Resource = c(
    "A",
    "B", "C", "C", "C", "A", "B", "B"
  )
), .Names = c(
  "Task", "Start",
  "Duration", "Resource"
), row.names = c(NA, -8L), class = "data.frame")
plotGantt(tmpdf, "Sample Client")

DoktorMike/datools documentation built on Feb. 28, 2021, 8:39 a.m.