Getting Excited about Juan Soto and Why Not to Worry About Bryce Harper's Batting Average


Soto’s Debut Nationals fans eagerly anticipated Juan Soto’s arrival to the major leagues, and boy, did he deliver. In his second MLB at-bat, and his first start, Soto laced a 422 foot drive off Robbie Erlin, driving in 3 and showing why he made such meteoric rise through the National’s minor league system. Soto’s promotion was the result of a particularly ill-timed injury to do-everything superstar Howie Kendrick, who was pressed into an everyday role at second base and the outfield following injuries to Daniel Murphy and Adam Eaton.

Read More

Cracking Combination Locks With Numpy


Background My dad recently came to me with an interesting proposition - cracking a combination lock where the first and last numbers are (probably) known. He has a lock where the first and last digits are 6 and 4, respectively, but is looking to determine the middle two digits and hopefully crack the overall combination. My first thought was to simply generate all the possibilities of numbers - a relatively trivial task, easy but long.

Read More

NBA Rim Protection in 2017-2018


In an effort to determine the league’s best rim protectors, I’ve put together a statistic I’d like to call RIMD: a weighted efficiency statistic that seeks to measure how effectively players can defend shots at the rim, giving preference to those who contest a large volume of shots each game. With the basic NBA Advanced Stats for rim protection in hand (looking at all shots 0-6 feet from the basket), here’s how to calculate RIMD for a given player:

Read More

NBA Usage Rate Leaders


A Primer on Usage Rate Usage rate describes the percentage of team plays used by a particular player while that player is on the court - basically, how likely a given player is to end a possession with a field goal attempt, free throws, or a turnover. This is a great indicator of how “ball dominant” a particular player is, and the degree to which a team’s central offensive player finished possessions can tell us a great deal about how that team plays on offense.

Read More

Visualizing MLB Team Payroll Spending


Partly in an effort to learn Tableau a little better, partly in an effort to see what the Nat’s historical payroll looks like, and partly because I hadn’t seen a tool like this before, I put together a Tableau Public graphic detailing each MLB team’s payroll spending since the turn of the millenium. Check it out! Shoutout to Baseball Prospectus and Cot’s Contracts for supplying the underlying yearly data. var divElement = document.

Read More

Explore the World's Most Nutritious Foods with Shiny


A recent study by food scientists titled “Uncovering the Nutritional Landscape of Food” ranked the world’s healthiest foods, focusing on options which will help fulfill, but not exceed, your daily nutritional requirements. In this context, foods which are nutritionally well-rounded and adaptable to a variety of diets rate out highly, while more “one sided” foods slip down the rankings. Luckily for us, the researchers also published the data they used for the study, allowing us to view and manipulate the information.

Read More

Hosting your Own RStudio and Shiny Servers in the Cloud


I’ve been mucking around in R quite a bit lately and have grown tired of all the annoying configuration changes that are required to take your data/analysis from one machine to another. Even with my code in a Git repository, I was still dealing with package inconsistencies across R environments, differing file paths, and more - needless issues that took me away from the analysis at hand. Combined with a desire to have an always-on machine available to host Shiny apps, I decided to provision my own cheap, always-up cloud server to run RStudio and Shiny Server.

Read More

Visualizing Historical NBA All Star Game Scoring with Tableau


This year’s All Star Game pitting Team LeBron vs Team Steph was an unexpected delight - seemingly the first time in years that any actual defense was played (thanks Joel Embiid!) and the players truly cared about the outcome. Accordingly, the total points scored dropped from last year’s all time high of 374 to a more “normal” 293. That’s still a ton of points though - certainly a lot more than any old regular season basketball game… which got me thinking - was the All Star Game always like this?

Read More

The Cavs Blow It Up: 2018 Trade Deadline Edition


Overview Last time I posted about the Cavs, they were on the mend and in the midst of a 13-game winning streak. Since? Not great. The Cavs have been one of the worst teams in the league since, posting the NBA’s 5th worst Net Rating of -4.5, ahead of only the Magic, Nets, Kings, and Suns. Poor company for a team that fancied itself a perennial contender and Eastern Conference hegemon.

Read More

NBA Hot Takes: Trades and Injuries Edition


Trading Blake makes the Clippers Better There’s already a general consensus amongst NBA talking heads that the Blake trade was a smart move for the Clippers - getting off the nearly $140 million remaining on his contract will dramatically increase their flexibility in building for the future. What makes this deal especially interesting, though, is that I also think it makes this Clippers better, this season. It’s common wisdom in the NBA that the team getting the best player usually wins the trade… not so here.

Read More