I know we can create Gantt Charts in R, but I would like to be able to create a table that contains some 5-7 rows of data and then a Gantt chart to the right.
df <- structure(list(Position = structure(c(1L, 1L, 1L, 2L, 2L, 2L), .Label = c("President",
"Vice"), class = "factor"), Name = structure(c(4L, 1L, 3L, 1L,
3L, 2L), .Label = c("Adams", "Burr", "Jefferson", "Washington"
), class = "factor"), correct = c(TRUE, TRUE, TRUE, TRUE, TRUE,
TRUE), win = c(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), start = structure(c(-66021,
-63153, -61693, -66021, -63153, -61693), class = "Date"), end = structure(c(-63153,
-61693, -58771, -63153, -61693, -58771), class = "Date")), .Names = c("Position",
"Name", "position", "win", "start", "end"), class = "data.frame", row.names = c(NA,
-6L))
df
Position Name correct win start end
1 President Washington TRUE FALSE 1789-03-29 1797-02-03
2 President Adams TRUE FALSE 1797-02-03 1801-02-03
3 President Jefferson TRUE FALSE 1801-02-03 1809-02-03
4 Vice Adams TRUE FALSE 1789-03-29 1797-02-03
5 Vice Jefferson TRUE FALSE 1797-02-03 1801-02-03
6 Vice Burr TRUE FALSE 1801-02-03 1809-02-03
So I would want to have Position, Name, correct & win as columns in a table, and then to the right, the bars showing the timelines. How would I go about creating these in R?