Learn R Programming

plan (version 0.4-2)

as.gantt: Read a gantt data file

Description

Read a data file containing gantt information.

Usage

as.gantt(key, description, start, end, done, neededBy)

Arguments

key

integer key for task, normally 1 for the first task, 2 for the second, etc.

description

character string describing the task (brief)

start

start date for task (POSIXt or character string that converts to POSIXt with as.POSIXct

end

end date for task (POSIXt or character string that converts to POSIXt with as.POSIXct

done

percentage completion for the task

neededBy

optional key for a dependent task

Value

An object of type "gantt"; for details, see read.gantt.

Details

Creates a gantt object. See documentation for read.gantt, which uses as.gantt.

See Also

read.gantt, summary.gantt and plot.gantt

Examples

Run this code
# NOT RUN {
library(plan)
arrive <- as.POSIXct("2012-09-05")
month <- 28 * 86400
year <- 12 * month
leave <- arrive + 4 * year
startT1 <- arrive
endT1 <- startT1 + 4 * month
startT2 <- endT1 + 1
endT2 <- startT2 + 4 * month
startT3 <- arrive + 12 * month
endT3 <- startT3 + 4 * month
startQE <- arrive + 9 * month
endQE <- arrive + 12 * month
QEabsoluteEnd <- arrive + 15 * month
startProposal <- arrive + 15 * month # for example
endProposal <- arrive + 20 * month
startThesisWork <- arrive + 2 * month # assumes no thesis work until 2 months in
endThesisWork <- leave - 4 * month
startThesisWriteup <- leave - 4 * month
endThesisWriteup <- leave
g <- as.gantt(key=1:7, c("Term 1 classes",
              "Term 2 classes",
              "Qualifying Examination",
              "Term 3 classes",
              "Proposal Defence",
              "Thesis Work",
              "Thesis Writing/Defence"),
              c(startT1, startT2, startQE, startT3, startProposal,
                startThesisWork, startThesisWriteup),
              c(endT1, endT2, endQE, endT3, endProposal,
                endThesisWork, endThesisWriteup),
              done=rep(0, 7))
plot(g, xlim=c(arrive, leave))
# }

Run the code above in your browser using DataLab