In Chapter 3, I don’t believe there is a hopbaseball.csv file mentioned, but there is hofbatting.csv and hofpitching.csv. These two files are available in the data folder on Github https://github.com/beanumber/baseball_R/tree/master/data

]]>I was wondering how to get the hofbaseball.csv file to use for Chapter 3? I know it wasn’t in the original files when I download the csv files for 2017, but I can’t seem to figure out how to get a hold of it? ]]>

For example, on the tab “Tag from third graphic”, if you set the slider to 0.75, you see there’s big edge in tagging in all two outs (after the catch) situations, and not much difference if the catch was the first out. If the ball is deep enough for an 85% success rate, there is big edge in all situations.

The corresponding tables show that in most situations, the baserunners were too cautious. For example, in row 6 of the second to home table, you see that they only attempted to score 55% of the time, yet were safe on 95% of the attempts. The breakeven success rate is 0.7 for that situation.

I built it into a shiny app, https://malter61.shinyapps.io/BaseballStats/. Please take a look.

Mark Malter ]]>

By golly, I got it to work. You have no idea how much I have learned from your book Analyzing Baseball Data with R and this blog, Jim. After 44 years of teaching (I’m in year 18 & looking to pivot into a career in data analysis) you deserve every bit of your retirement. But if you ever teach a class online, please let me know. I’ll be at the front of the line to sign up.

]]>Even, thanks for your interest. I’d suggest looking at the code for that particular Shiny app on Github. See https://github.com/bayesball/ShinyBaseball/blob/main/inst/shiny-examples/RadialChart/app.R

Jim

]]>This is very interesting, but I am having a bit of trouble replicating it. Specifically with this part: We define a vector of angles from – \pi /2 to \pi / 2 and define a data frame df_new2 containing the points of the semi-circle.

There doesn’t seem to be an example of how what df_new2 <- ??? should be. So I get a df_new2 not found error.

Any advice? I'm new to R and learning it through your's and Max's book.

Appreciate any assistance.

]]>James, since you asked, here are the functions I wrote: https://gist.github.com/bayesball/de552bc32575bfbf50362081ae4fda99

Since there is a lot here, I decided not to mention the code on the post.

Jim

]]>Good point. I wrote the post to provide an introduction to that particular paper and they were using batter sequence number as a covariate. Perhaps cumulative pitch count would be a good alternative covariate.

]]>