I have a (large) dataset where I know, for each observation, the departure and the arrival time of a worker (between 0 and 24, in decimal) :
ID Departure_time Arrival_time 0001 07.00 08.25 0002 07.55 08.20 0003 08.10 09.75 ... ... ...
I can plot the density of the departure_time (or arrival_time) easily :
ggplot(df, aes(x=Departure_time)) + geom_density(adjust=.5)
I would like to plot the density of workers traveling for a given time (for each moment, the number of worker who are not at work (prior to arrival_time) but who have left home (after departure_time).