Hello -- here is my dataset. I want to find two things specifically: I want to find the number of events that occur after a specific event (for example: how many times does a jump/run/stand event take place after a "run" event). From that, I would like to find the difference in "time" values that occurs in between these events, ultimately generating an average time for each event (for example: after a run event, the average time is "x" until the next stand/jump/run event.) I hope this makes a bit of sense. The day column is so that I can eventually do all of this in a code that will specify the results by the day that it takes place.
dput(jump_edit)
structure(list(Time = c(12, 43, 68, 87, 99, 194, 283, 290, 298,
302, 385, 409, 586, 599, 689, 750, 801), Event = c("Stand", "Jump",
"Jump", "Run", "Stand", "Stand", "Stand", "Run", "Run", "Jump",
"Jump", "Jump", "Stand", "Stand", "Jump", "Stand", "Jump"), Day = c(1,
1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4)), class = c("spec_tbl_df",
"tbl_df", "tbl", "data.frame"), row.names = c(NA, -17L), spec = structure(list(
cols = list(Time = structure(list(), class = c("collector_double",
"collector")), Event = structure(list(), class = c("collector_character",
"collector")), Day = structure(list(), class = c("collector_double",
"collector"))), default = structure(list(), class = c("collector_guess",
"collector")), skip = 1), class = "col_spec"))