ganttAddTask {plan} | R Documentation |
Add a task to a gantt object
Description
This can be a simpler method than using as.gantt()
, because
tasks can be added one at a time.
Usage
ganttAddTask(
g,
description = "",
start = NA,
end = NA,
done = 0,
neededBy = NA,
key
)
Arguments
g |
A gantt object. |
description |
A character string describing the task. |
start |
A character string indicating the task start time, in a format understood by |
end |
A character string indicating the end time, in a format understood by |
done |
A numerical value indicating the fraction done. |
neededBy |
An integer indicating a task that depends on the completion of this task. If this is
|
key |
An optional value indicating the desired key value. If not given, this will default to
one beyond the highest key in |
See Also
Other things related to gantt data:
as.gantt()
,
gantt-class
,
gantt
,
plot,gantt-method
,
read.gantt()
,
summary,gantt-method
Examples
library("plan")
g <- new("gantt")
g <- ganttAddTask(g, "Courses") # no times, so a heading
g <- ganttAddTask(g, "Physical Oceanography", "2016-09-03", "2016-12-05")
g <- ganttAddTask(g, "Chemistry Oceanography", "2016-09-03", "2016-12-05")
g <- ganttAddTask(g, "Fluid Dynamics", "2016-09-03", "2016-12-05")
g <- ganttAddTask(g, "Biological Oceanography", "2017-01-03", "2017-04-05")
g <- ganttAddTask(g, "Geological Oceanography", "2017-01-03", "2017-04-05")
g <- ganttAddTask(g, "Time-series Analysis", "2017-01-03", "2017-04-05")
g <- ganttAddTask(g, "Research") # no times, so a heading
g <- ganttAddTask(g, "Literature review", "2016-09-03", "2017-04-05")
g <- ganttAddTask(g, "Develop analysis skills", "2016-09-03", "2017-08-01")
g <- ganttAddTask(g, "Thesis work", "2017-01-01", "2018-04-01")
g <- ganttAddTask(g, "Defend thesis proposal", "2017-05-01", "2017-06-01")
g <- ganttAddTask(g, "Write papers & thesis", "2017-05-01", "2018-04-01")
g <- ganttAddTask(g, "Defend thesis", "2018-05-01", "2018-05-15")
# Set 'font' for bold-faced headings
font <- ifelse(is.na(g[["start"]]), 2, 1)
plot(g, ylabel=list(font=font))