Skip to contents

[Experimental] Prepares data by selecting and re-naming columns to conform to the format previously used for raw OTP data.

Usage

prepare_raw_otp(data, oldstyle = FALSE, ...)

Arguments

data

A data.frame returned from the report_otp() function.

oldstyle

Ignore

...

Ignored for now.

Value

A data.frame with columns:

Date

chr Date in mm/dd/yyyy format

concatRouteDate

chr Route number and date, can be used as ID

Route

int Visible route number

Vehicle

chr Vehicle number

Anchor.Location

chr Anchor location

Planned.Start.Time

chr Planned start time

Planned.Anchor.Time

chr Planned anchor time

Actual.Arrival.Time

chr Actual arrival time

Delay.Minutes.

int Delay time, in minutes

OnTimeRateByAnchor

dbl Arrived on or before planned anchor time

Within5MinOfAnchor

dbl Arrived within 5 minutes of planned anchor time

Within10MinOfAnchor

dbl Arrived with 10 minutes of planned anchor time

TrueOnTime

dbl Arrived within 15 minutes of planned anchor time

Late10Min

dbl Arrived within 25 minutes of planned anchor time

Late15Min

dbl Arrive within 30 minutes of planned anchor time

Late25Min

dbl Arrived within 40 minutes of planned anchor time

Late30Min

dbl Arrived within 45 minutes of planned anchor time

AMPM

chr AM or PM route

TimeTier

chr Planned arrival time tier

TypeOfBus

chr Bus type

BusDay

chr Bus and day combined

Yard

chr Bus yard

X.1

chr Ignore

X.2

chr Ignore

AnchorTimeConverted

dbl Anchor Time in seconds

X.5

chr Ignore

Uncovered

lgl Was the route reported to be uncovered

excludedShuttles

lgl Is the route a shuttle that should be excluded from OTP calc

Direction

chr Inbound or Outbound route

Details

Note that this function does not need to be called directly before uploading OTP reports. The update_otp_report() function will prepare raw data for upload automatically.