# NOT RUN {
sch <- sch_new() %>%
sch_title("Project 1: Cost Information System") %>%
sch_reference(
"VANHOUCKE, Mario. Integrated project management and control:
first comes the theory, then the practice.Gent: Springer, 2014, p. 6"
) %>%
sch_add_activities(
id = 1:17,
name = paste("a", as.character(1:17), sep=""),
duration = c(1L,2L,2L,4L,3L,3L,3L,2L,1L,1L,2L,1L,1L,1L,1L,2L,1L)
) %>%
sch_plan()
sch_has_any_relation(sch) # FALSE
sch_nr_relations(sch) # 0
sch_duration(sch) # 4
sch %<>%
sch_add_relations(
from = c(1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 4L, 5L, 6L,
7L, 8L, 9L, 10L, 11L, 11L, 12L, 12L, 13L, 13L, 14L, 14L, 15L, 15L),
to = c(2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 11L, 11L,
12L, 13L, 14L, 15L, 16L, 17L, 16L, 17L, 16L, 17L, 16L, 17L, 16L, 17L)
) %>%
sch_plan()
sch_has_any_relation(sch) # TRUE
sch_nr_relations(sch) # 26
sch_duration(sch) # 11
# }
Run the code above in your browser using DataLab