By default calling this function on an
otpdata object (returned by the report_otp() function)
will update the internal and external summary reports, as well as the unreported and AM raw data archives.
Updates to each of these can be disabled by setting the corresponding id argument to FALSE. For example,
to skip updating the external report and the raw data archive, call update_otp_report(id=FALSE, am_raw_id = FALSE).
Usage
update_otp_report(
data,
id = c(Sys.getenv("OTP_REPORT_ID")),
internal_id = Sys.getenv("OTP_REPORT_INTERNAL_ID"),
dashboard_id = Sys.getenv("OTP_DASHBOARD_ID"),
am_raw_id = Sys.getenv("OTP_AM_RAW_ID"),
pm_raw_id = Sys.getenv("OTP_PM_RAW_ID"),
full_datadir_id = Sys.getenv("OTP_FULL_DATADIR_ID"),
unreported_id = Sys.getenv("OTP_UNREPORTED_ID"),
sheet = Sys.getenv("OTP_SHEET"),
trip_issue_id = Sys.getenv("TRIP_ISSUE_ID"),
mail_from = Sys.getenv("MAIL_FROM"),
...
)
# S3 method for otpdata
update_otp_report(
data,
id = c(Sys.getenv("OTP_REPORT_ID")),
internal_id = Sys.getenv("OTP_REPORT_INTERNAL_ID"),
dashboard_id = Sys.getenv("OTP_DASHBOARD_ID"),
am_raw_id = Sys.getenv("OTP_AM_RAW_ID"),
pm_raw_id = Sys.getenv("OTP_PM_RAW_ID"),
full_datadir_id = Sys.getenv("OTP_FULL_DATADIR_ID"),
unreported_id = Sys.getenv("OTP_UNREPORTED_ID"),
sheet = Sys.getenv("OTP_SHEET"),
trip_issue_id = Sys.getenv("TRIP_ISSUE_ID"),
mail_from = Sys.getenv("MAIL_FROM"),
...
)
# S3 method for otpsummary
update_otp_report(
data,
id = c(Sys.getenv("OTP_REPORT_ID")),
dashboard = FALSE,
sheet = Sys.getenv("OTP_SHEET"),
...
)Arguments
- data
summarized OTP data to write, i.e. a
data.framereturned bysummary.otpdata()- id
Google Sheet ID of the sheet to be updated
- internal_id
Google Sheet ID of the internal report. If
FALSEdo not update the internal report.- dashboard_id
Google Sheet ID of the dashboard data. If
FALSEdo not update the dashboard data.- am_raw_id
Google Sheet ID of the AM raw data. If
FALSEdo not update the AM raw data.- pm_raw_id
Google Sheet ID of the PM raw data. If
FALSEdo not update the PM raw data.- full_datadir_id
Google Drive ID of full data archive directory. If
FALSEdo not update the full data archive.- unreported_id
Google Sheet ID of the AM raw data. If
FALSEdo not update the unreported data.- sheet
Google sheet worksheet name to write to
- trip_issue_id
Google Sheet ID of the report issue log sheet. If
FALSEdo not update the report issue log.- mail_from
Admin Google account email address that will retain edit access to locked Google sheets.
- ...
ignored
- dashboard
flag indicating if
idpoints to the dashboard data
Methods (by class)
update_otp_report(otpdata): Theupdate_otp_report.otpdatamethod updates the internal and external summary reports, as well as the unreported and AM raw data archives.update_otp_report(otpsummary): Update OTP report with summarized OTP dataThe
.otpsummarymethod is used internally by theupdate_otp_reportfunction and will not usually be called by users directly.