Skip to contents

BPSTranspoReportR is an R package that provides easy to use functions for generating reports and data summaries from data stored in Versatrans Routing and Planning / Onscreen, and Zonar. It includes functions for reporting on-time performance, weekly route changes, and more.

Installation

BPSTranspoReportR is currently available from our GitHub page. You can install the development version of BPSTranspoReportR from GitHub with:

# install.packages("remotes") ## if you don't have remotes installed already
# options(pkgType = "binary") ## if you don't have build tools installed and configured
remotes::install_github(c("BostonPublicSchools/RVersatransRP",
                          "BostonPublicSchools/RZonar",
                          "BostonPublicSchools/BPSTranspoReportR"))

Development status and updates

BPSTranspoReportR is currently in active but early development. The API for some functions is still evolving and may change. If you wish to keep up to date with the latest development version start a fresh R session and run

# install.packages("remotes") ## if you don't have remotes installed already
# options(pkgType = "binary") ## if you don't have build tools installed and configured
remotes::install_github(c("BostonPublicSchools/RVersatransRP",
                          "BostonPublicSchools/RZonar",
                          "BostonPublicSchools/BPSTranspoReportR"),
                          force = TRUE)

Example

This example shows you how to run a basic on-time performance (OTP) report:

library(BPSTranspoReportR)

## run report for yesterday
otpdata <- report_otp(as.character(Sys.Date() -1))
## OTP data structure:
dplyr::glimpse(otpdata[0, ])
#> Rows: 0
#> Columns: 38
#> $ Date                   <dttm> 
#> $ Route                  <chr> 
#> $ Vehicle                <chr> 
#> $ Direction              <chr> 
#> $ TripOutcome            <chr> 
#> $ TrueOnTime             <lgl> 
#> $ OnTimeByAnchor         <lgl> 
#> $ ExpectedTime           <dttm> 
#> $ AnchorTime             <dttm> 
#> $ ArrivalTime            <dttm> 
#> $ ArrivalTimeSource      <chr> 
#> $ DelayTime              <dbl> 
#> $ DelayTimeByAnchor      <dbl> 
#> $ AnchorAbbrev           <chr> 
#> $ AMPM                   <chr> 
#> $ TimeTier               <time> hms()
#> $ Yard                   <chr> 
#> $ RouteName              <chr> 
#> $ TypeOfBus              <chr> 
#> $ ActualLoad             <int> 
#> $ Days                   <chr> 
#> $ RouteSetName           <chr> 
#> $ Names                  <chr> 
#> $ excludedShuttles       <lgl> 
#> $ OriginalRPVehicle      <chr> 
#> $ Zone                   <chr> 
#> $ ZonarCategory          <chr> 
#> $ ZonarDuration          <drtn>  secs
#> $ ArrivalInZonar         <lgl> 
#> $ ArrivalInOnscreen      <lgl> 
#> $ ZoneInZonar            <lgl> 
#> $ OSVehicleOverride      <lgl> 
#> $ RPOSAnchorTimeMismatch <lgl> 
#> $ InOSRPSchedule         <lgl> 
#> $ InRPRoute              <lgl> 
#> $ InArrivalWindow        <lgl> 
#> $ Uncovered              <lgl> 
#> $ Unreported             <lgl>

Credentials and other private information

Usernames, passwords, and other private information will usually be needed in order to access the data sources required to generate reports. By default these are retrieved from environment variables as described in credentials vignette.

Help and support

Please report bugs and make feature requests by opening an issue at https://github.com/BostonPublicSchools/BPSTranspoReportR/issues. Keep in mind that this issue tracker is public and do not include any credentials or other private data or informaton in your issue reports.

You may also reach out to the package maintainer directly via email.