MLB Players 2008

Mike Krcatovich
June 24, 2020

Introduction

Baseball is a game of statistics. Whether comparing players of similar caliber or trying to understand the difference between players considered good, great or elite, my app will help you to sift through players' stats from the 2008 season seamlessly. You should purchase this app because:

  • You get instantaneous feedback on three historically significant statistics from a large group of players
  • You can choose between infielders, outfielders or all offensive players
  • The blueprint is available: make this app more specific and complex if you wish!

About the App

To use the app, simply:

  • Choose whether you want to consider infielders, outfielders or all offensive players available
  • Slide the sliders between the high and low parameters for batting average, RBI and home runs
  • You will see a list of all players who meet the criteria you chose pop up on your screen. In the adjacent tab, read the full instructions.

Server Code

library(shiny)
library(googlesheets)
baseball<-read.csv("URL NAME HERE")
#Create "IF" and "OF", which reduce data frame to include only infielders or outfielders, respectively
shinyServer(function(input,output){

    output$this<-renderText({
    if(input$position_group=="Infield"){baseball=IF}
    if(input$position_group=="Outfield"){baseball=OF}
    this<-subset(baseball,baseball$AVG>=.001*input$BA[1]&baseball$AVG<=.001*input$BA[2]&baseball$HR>=input$HR[1]&baseball$HR<=input$HR[2]&baseball$RBI>=input$RBI[1]&baseball$RBI<=input$RBI[2])
    this<-this[,1]
    this
    })
    }
)

Sample Result

plot of chunk unnamed-chunk-1