sch_xy_gantt_matrix: XY Gantt Matrix

Description Usage Arguments Value See Also Examples

View source: R/sch_schedule.R

Description

Transform a Gantt matrix into x, y coordinates and the weight one. Each point greater than zero in a Gantt matrix becomes a x, y coordinate. Atention: the schedule must be planned with the function sch_plan().

Usage

1
sch_xy_gantt_matrix(sch, gantt = NULL)

Arguments

sch

A schedule object.

gantt

A Gantt Matrix. If it is not informed, it will use gantt_matrix() before this function.

Value

A matrix with three columns: x, y and weight.

See Also

sch_relations(), sch_activities(), sch_add_activities(), sch_add_relations(), sch_add_relation(), sch_plan(), sch_gantt_matrix().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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)

xyw <- sch_xy_gantt_matrix(sch)
xyw
plot(xyw[, 1:2])

rubens2005/criticalpath documentation built on Feb. 6, 2022, 10:54 p.m.