Cap trip rate factors
cap_trip_rate_factors.RdCaps trip rate factors to specified upper and lower bounds for each platform and day group.
Arguments
- rescaled_factors
data.table with required columns:
trip_type
— trip type label app_weekday
— trip rate factor for app platform, weekday app_weekend
— trip rate factor for app platform, weekend web_weekday
— trip rate factor for web platform, weekday web_weekend
— trip rate factor for web platform, weekend Additional columns as needed for other platforms and day groups Rows: one per trip type. Keys: (trip_type). Modified by reference: no (returns copy).
- upper_bounds
numeric or named vector. Upper bound(s) for trip rate factors (default: 2).
- lower_bounds
numeric or named vector. Lower bound(s) for trip rate factors (default: 1).
Value
data.table with columns:
trip_type
— trip type label app_weekday
— capped trip rate factor for app platform, weekday app_weekend
— capped trip rate factor for app platform, weekend web_weekday
— capped trip rate factor for web platform, weekday web_weekend
— capped trip rate factor for web platform, weekend Additional columns as needed for other platforms and day groups. Rows: one per trip type. Keys: (trip_type). Modified by reference: no (returns copy).