I've been racking my brain at the following issue.
Let's say I have transcript data from speakers. Every row is a particular utterance from a speaker (given by speaker_id) and when they started talking, Timestamp. Sometimes consecutive rows will contain utterances from the same speaker because they continue speaking after a pause.
I'd like to figure out the total amount of time the speakers in the dataset have spoken, which requires that I compute the difference between the start of a timestamp and the beginning of the first timestamp of the next speaker. How would I do this?
Here's a sample of the dataset
file = read.table(text = "speaker_id,Timestamp
5,2022-03-30 03:00:00
5,2022-03-30 03:00:24
3,2022-03-30 03:00:52
3,2022-03-30 03:00:56
3,2022-03-30 03:00:58
5,2022-03-30 03:01:25
5,2022-03-30 03:02:15
3,2022-03-30 03:03:14
5,2022-03-30 03:03:36
3,2022-03-30 03:04:26
3,2022-03-30 03:06:02
3,2022-03-30 03:06:10
5,2022-03-30 03:06:28
5,2022-03-30 03:07:28
3,2022-03-30 03:08:56
5,2022-03-30 03:09:11
5,2022-03-30 03:10:02
5,2022-03-30 03:10:56
3,2022-03-30 03:11:53
5,2022-03-30 03:12:20", header = T, sep = ",")
Any ideas?