# NOT RUN {
sch <- sch_new() %>%
sch_add_activities(
id = c( 1L, 2L, 3L, 4L),
name = c("A", "B", "C", "D"),
duration = c( 2L, 3L, 1L, 2L )
) %>%
sch_add_relations(
from = c(1L, 2L, 4L, 4L),
to = c(3L, 3L, 1L, 2L)
) %>%
sch_plan()
sch_duration(sch)
gantt <- sch_gantt_matrix(sch)
gantt
# What is the effort by time period?
colSums(gantt) # 1 1 2 2 1 1
# What is the duration by activities?
rowSums(gantt) # 2 3 1 2
# what is the S curve
cumsum(colSums(gantt))
plot(cumsum(colSums(gantt)), type="l", lwd=3)
# }
Run the code above in your browser using DataLab