'Visualize start and end of activities as geom_segments relative to base line activity
I have a table such as this:
df <- structure(list(Line = c("130", "131", "132", "133", "134", "135",
"136", "137", "139", "140", "141"),
Actor = c("R", "R", "R", "R", "B", "R", "B", "B", "M", "M", "M"),
Act_cat = c("ver", "SpeechRec", "ges", "ges", "gaze", "ges", "gaze", "gaze", "gaze", "gaze", "gaze"),
Activity = c("dort drüben könnt ihr sehen wer damals auf der sparrenburg gewohnt hat",
"schwert", "D-onset", "D-peak", "~", "D-retract", "@tum", "~", "~", "@tum", "~"),
Starttime_ms = c(48825, 48865, 49220, 50080, 50730, 50900,
51009, 51191, 51486, 51809, 52251),
Endtime_ms = c(53035, 49865, 50080, 50900, 51009, 52220, 51191, 51270, 51808, 52250,
52332),
Duration = c(4210, 1000, 860, 820, 279, 1320, 182, 79, 322, 441, 81)), class = c("grouped_df", "tbl_df", "tbl", "data.frame"), row.names = c(NA, -11L),
groups = structure(list(File = "VP_4_004", .rows = structure(list(1:11), ptype = integer(0), class = c("vctrs_list_of","vctrs_vctr", "list"))),
row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame"), .drop = TRUE))
I want to visualize how the Activitys after the first temporally relate to that first Activity, namely "dort drüben könnt ihr sehen wer damals auf der sparrenburg gewohnt hat". The kind of visualization I have in mind would involve the use of geom_segments for each Activity, their positions and end points would be determined by their Starttime_ms and, respectively, Endtime_ms values and could look roughly like this:
How can this be obtained? Thanks in advance!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

