HyannisHarborHawks commited on
Commit
1e2104a
·
verified ·
1 Parent(s): c558065

Update app.R

Browse files
Files changed (1) hide show
  1. app.R +12 -2
app.R CHANGED
@@ -1300,7 +1300,7 @@ ui <- fluidPage(
1300
  fileInput("file", "Outing CSV (TrackMan)", accept = ".csv",
1301
  buttonLabel = "Browse", placeholder = "No file"),
1302
  checkboxInput("needs_cleaning",
1303
- "Raw data \u2014 run cleaning + tagging", value = TRUE),
1304
  selectInput("pitcher", "Pitcher", choices = NULL, width = "100%"),
1305
  selectInput("game", "Outing", choices = NULL, width = "100%"),
1306
  selectInput("ref_source", "vs. Season reference",
@@ -1572,7 +1572,17 @@ server <- function(input, output, session) {
1572
  req(raw_upload())
1573
  if (isTRUE(input$needs_cleaning)) {
1574
  withProgress(message = "Cleaning + tagging data\u2026", {
1575
- clean_college_data(raw_upload())
 
 
 
 
 
 
 
 
 
 
1576
  })
1577
  } else {
1578
  raw_upload()
 
1300
  fileInput("file", "Outing CSV (TrackMan)", accept = ".csv",
1301
  buttonLabel = "Browse", placeholder = "No file"),
1302
  checkboxInput("needs_cleaning",
1303
+ "Raw data \u2014 run cleaning + tagging", value = FALSE),
1304
  selectInput("pitcher", "Pitcher", choices = NULL, width = "100%"),
1305
  selectInput("game", "Outing", choices = NULL, width = "100%"),
1306
  selectInput("ref_source", "vs. Season reference",
 
1572
  req(raw_upload())
1573
  if (isTRUE(input$needs_cleaning)) {
1574
  withProgress(message = "Cleaning + tagging data\u2026", {
1575
+ tryCatch(
1576
+ clean_college_data(raw_upload()),
1577
+ error = function(e) {
1578
+ showNotification(
1579
+ paste0("Cleaning failed: ", conditionMessage(e),
1580
+ " \u2014 if this file is already cleaned, leave the \u201cRaw data\u201d box unchecked."),
1581
+ type = "error", duration = 12
1582
+ )
1583
+ NULL
1584
+ }
1585
+ )
1586
  })
1587
  } else {
1588
  raw_upload()