Calculate the vehicle-kilometres travelled by groups of trips
calculate_vkt(gtfs, trips, date, window, lengths = NULL)A data.table with the columns group, n_days, vkt and
vkt_daily_mean, as described in get_vkt(), with one row for each
group in trips, in their order. Groups without any counted departure
have n_days 0 and NA vkt.
A GTFS object, as created by read_gtfs().
A data.table with the columns trip_id, service_id and
group (the group of each trip, such as its route), in the order of the
trips table.
A Date vector with the days to be counted, or NULL to count
every day on which the services of trips run.
An integer vector with the start and end of the time of day,
in seconds after midnight, as returned by time_of_day_window(), or
NULL to count every departure.
A data.table with the columns trip_id and length (in
km, or in the unit in which the vkt is wanted), as returned by
get_trip_length(), or NULL to calculate the lengths of the counted
trips (in km).