igroffman commited on
Commit
18618e7
·
verified ·
1 Parent(s): 53c2360

Update app.R

Browse files
Files changed (1) hide show
  1. app.R +16 -0
app.R CHANGED
@@ -4153,6 +4153,22 @@ create_advanced_pitcher_pdf <- function(game_df, pitcher_name, output_file, logo
4153
  )
4154
  pitch_char <- pitch_result$stats
4155
  pitch_colors_matrix <- pitch_result$colors
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4156
 
4157
  # Handle empty pitch_char
4158
  if (is.null(pitch_char) || nrow(pitch_char) == 0) {
 
4153
  )
4154
  pitch_char <- pitch_result$stats
4155
  pitch_colors_matrix <- pitch_result$colors
4156
+
4157
+ # ===== ADD THIS DEBUGGING BLOCK =====
4158
+ message("========== PITCH CHARACTERISTICS DEBUG ==========")
4159
+ message("pitch_char class: ", class(pitch_char))
4160
+ message("pitch_char dimensions: ", nrow(pitch_char), " rows x ", ncol(pitch_char), " cols")
4161
+ message("pitch_char column names: ", paste(names(pitch_char), collapse = ", "))
4162
+ if (nrow(pitch_char) > 0) {
4163
+ message("First row Pitch value: ", pitch_char$Pitch[1])
4164
+ message("First row data:")
4165
+ print(pitch_char[1, , drop = FALSE])
4166
+ } else {
4167
+ message("WARNING: pitch_char has 0 rows!")
4168
+ }
4169
+ message("pitch_colors_matrix dimensions: ", nrow(pitch_colors_matrix), " x ", ncol(pitch_colors_matrix))
4170
+ message("==================================================")
4171
+ # ===== END DEBUG BLOCK =====
4172
 
4173
  # Handle empty pitch_char
4174
  if (is.null(pitch_char) || nrow(pitch_char) == 0) {