# NOT RUN {
# Example #1
sch <- sch_new() %>%
  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_duration(sch)
sch_activities(sch)
# Example #2
sch <- sch_new() %>%
  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),
    resource  = "Rubens",
    cost      = 123.45
  ) %>%
  sch_plan()
sch_duration(sch)
atb <- sch_activities(sch)
atb$resource
atb$cost
# Example #3
sch <- sch_new() %>%
  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),
    resource  = c(
      "Rubens", "Jose", "Rosa", "Rodrigues", "Silva",
      "Rubens", "Jose", "Rosa", "Rodrigues", "Silva",
      "Rubens", "Jose", "Rosa", "Rodrigues", "Silva",
      "Rubens", "Jose"),
    cost      = c(
      123.45, 234.56, 345.56, 456.78, 567.89,
      123.45, 234.56, 345.56, 456.78, 567.89,
      123.45, 234.56, 345.56, 456.78, 567.89,
      123.45, 234.56)
  ) %>%
  sch_plan()
sch_duration(sch)
atb <- sch_activities(sch)
atb$resource
atb$cost
# }
Run the code above in your browser using DataLab