Pitch location and Greinkes July Exploring Pitch Data in R Strike - - PowerPoint PPT Presentation

pitch location and greinke s july
SMART_READER_LITE
LIVE PREVIEW

Pitch location and Greinkes July Exploring Pitch Data in R Strike - - PowerPoint PPT Presentation

EXPLORING PITCH DATA IN R Pitch location and Greinkes July Exploring Pitch Data in R Strike zone success Exploring Pitch Data in R Locational variables > head(greinke[, c("px", "pz")]) px pz 1 1.714 1.925 2


slide-1
SLIDE 1

EXPLORING PITCH DATA IN R

Pitch location and Greinke’s July

slide-2
SLIDE 2

Exploring Pitch Data in R

Strike zone success

slide-3
SLIDE 3

Exploring Pitch Data in R

Locational variables

> head(greinke[, c("px", "pz")]) px pz 1 1.714 1.925 2 0.589 3.271 3 0.399 2.918 4 0.764 1.306 5 1.517 2.193 6 0.695 3.431

slide-4
SLIDE 4

Exploring Pitch Data in R

The px variable

  • Horizontal pitch location (feet)
  • px = 0: Center of plate
  • px < 0: Inside to RHB (outside to LHB)
  • px > 0: Outside to RHB (inside to LHB)
  • |px| > 0.83: Outside of strike zone
slide-5
SLIDE 5

Exploring Pitch Data in R

The pz variable

  • Vertical pitch location (feet)
  • pz = 0: Landed on front of plate
  • pz < 0: Landed before reaching plate
  • pz > 0: Above the plate (of interest)
  • 1.5 < pz < 3.4: Average strike zone
slide-6
SLIDE 6

Exploring Pitch Data in R

Ploing pitch data

> plot(greinke$pz ~ greinke$px, xlim = c(-3, 3), ylim = c(-1, 6)) > rect(-0.83, 0.83, 1.5, 3.5, col = "#00990040", border = NA)

slide-7
SLIDE 7

Exploring Pitch Data in R

Grids and binning data

> head(greinke_sub$zone) [1] 16 7 11 15 12 7

slide-8
SLIDE 8

EXPLORING PITCH DATA IN R

Let's practice!

slide-9
SLIDE 9

EXPLORING PITCH DATA IN R

for loops for plots

slide-10
SLIDE 10

Exploring Pitch Data in R

Using a for loop

> unique(greinke_sub$zone) [1] 16 7 11 15 12 18 6 10 19 8 14 5 20 2 13 9 3 [18] 4 1 17 > for(zone in unique(greinke_sub$zone)) { print(zone) } [1] 16 [1] 7 [1] 11 [1] 15 [1] 12 [1] 18 [1] 6 [1] 10 [1] 19 ...

slide-11
SLIDE 11

Exploring Pitch Data in R

Using a for loop

> for(zone in min(greinke_sub$zone):max(greinke_sub$zone)) { print(zone) } [1] 1 [1] 2 [1] 3 [1] 4 [1] 5 [1] 6 [1] 7 [1] 8 [1] 9 [1] 10 [1] 11 ...

slide-12
SLIDE 12

Exploring Pitch Data in R

for loops and ploing

> plot(greinke_sub$px, greinke_sub$pz, type = "n", xlab = "Horizontal Location", ylab = "Vertical Location", main = "Using text() on Plots") > grid() > text(0, 2.5, "Middle", cex = 2)

slide-13
SLIDE 13

Exploring Pitch Data in R

for loops and ploing

slide-14
SLIDE 14

Exploring Pitch Data in R

for loops and ploing

> plot(greinke_sub$px, greinke_sub$pz, type = "n", xlab = "Horizontal Location", ylab = "Vertical Location", main = "Using text() on Plots") > grid() > text(0, 2.5, "Middle", cex = 2) > text(-1.5, 4.5, "Top Left", cex = 2) > text(1.5, 0.5, "Bot Right", cex = 2)

slide-15
SLIDE 15

Exploring Pitch Data in R

for loops and ploing

slide-16
SLIDE 16

Exploring Pitch Data in R

> plot(greinke_sub$px, greinke_sub$pz, type = "n", xlab = "Horizontal Location", ylab = "Vertical Location", main = "Zone Locations") > grid() > for(i in 1:20) { text(mean(greinke_sub$zone_px[greinke_sub$zone == i]), mean(greinke_sub$zone_pz[greinke_sub$zone == i]), mean(greinke_sub$zone[greinke_sub$zone == i]), cex = 2) }

for loops and ploing

slide-17
SLIDE 17

Exploring Pitch Data in R

for loops and ploing

slide-18
SLIDE 18

EXPLORING PITCH DATA IN R

Let's practice!

slide-19
SLIDE 19

EXPLORING PITCH DATA IN R

Wrap-up

slide-20
SLIDE 20

Exploring Pitch Data in R

Difficult visual interpretation

slide-21
SLIDE 21

Exploring Pitch Data in R

Summarizing through binning data

Negative numbers show Greinke pitched in these bins less frequently in July

slide-22
SLIDE 22

Exploring Pitch Data in R

Count-based locational differences

Negative numbers show 0-2 pitches in these bins were less frequent than 3-0 pitches

slide-23
SLIDE 23

EXPLORING PITCH DATA IN R

Let's practice!