Activity
Mon
Wed
Fri
Sun
Oct
Nov
Dec
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
What is this?
Less
More

Memberships

Athlete Lab

Public • 105 • Free

4 contributions to Athlete Lab
Analyzing the Pittsburgh Pirates’ Top Prospects in Spring Training
https://medium.com/@danielthom18/analyzing-the-pittsburgh-pirates-top-prospects-in-spring-training-part-1-pitchers-f39a67473a09
3
0
Statcast Whiff Rate?
Does anyone know the easiest way to calculate whiff rate in R using statcast data?
1
2
New comment Mar 27
1 like • Mar 27
Going by Whiff rate as Whiffs per Swing, See if this helps: Your_Data_Here |> mutate(Swing = ifelse(description %in% c("hit_into_play", "foul_tip", "swinging_strike", "foul", "swinging_strike_blocked"), 1, 0)) |> mutate(Whiff = ifelse(description %in% c("swinging_strike", "swinging_strike_blocked", "foul_tip"), 1, 0)) |> mutate(Whiff = ifelse(Swing == 0, NA, Whiff)) |> summarise(.by = "batter_name", `Whiff %` = mean(Whiff, na.rm = TRUE))
Tips for coding more organized in R
1. When making a Shiny App, put the ui section in a script called ui.R and the server in server.R. As long as they're loaded and in the same directory they will run without having to type "shinyApp(ui, server)" 2. When you have a lot of lines of code to run simultaneously but highlighting is a drag, put all the code within {} brackets and just run the line with the end bracket, it will run all the code. 3. Put comments on your code, and if you use at least four pound signs #### R Script will recognize it as a chapter for the outline table of contents, making it so much easier to find your sections in long scripts. 4. Consider using Projects within RStudio, which you can read more about here: https://support.posit.co/hc/en-us/articles/200526207-Using-RStudio-Projects
2
2
New comment Mar 29
Introduce Yourself
Please let the group know who you are! Introductions don't have to be long, but please make sure to provide the following: - Name - Current Occupation (Or School) - Your Short-Term & Long-Term Career Goals - What You're Looking To Get Out Of This Community
3
18
New comment Apr 25
2 likes • Mar 4
My name is Danny and I'm a course aid here at Athlete Lab. I'm a graduate of University of Illinois at Urbana-Champaign and worked as an analyst with their baseball team. My short term goal today is to build my portfolio with the work I do here and with more projects in R. My long term goal is to become a Senior Data Analyst for an MLB team. I look forward to meeting everyone here.
1-4 of 4
Danny Thompson
2
12points to level up
@danny-thompson-7182
Course Instructor at Athlete Lab

Active 5d ago
Joined Mar 3, 2024
INTP
powered by