A

A Sports Statistics Problem Solved in 30 Lines of Tidyverse Code

Hacker News

A Sports Statistics Problem Solved in 30 Lines of Tidyverse Code

When Scott Nestler announced via slack channel that he'd released a new edition of his sports statistics book, I was curious whether it would make a great gift for my dad, who loves horse racing. After some online searches didn't tell me how much of the book concerned horse racing, I started typing a message to Scott to ask. Mid-message, I realised I could probably answer it myself. A quick search for the book's title with search operator filetype:pdf located a copy. It's 377 pages. I could control + f for horse racing, but my dad likes other sports too, so I figured I'd come this far, let's take a second and do this properly. Wikipedia had a lit of all sports but it's a tad too comprehensive for what I needed, so I grabbed a list of sports off another site that came up when I searched for a list of sports. I wrote 30 lines of tidyverse code [1] that downloads the 377 page pdf, parses every word in it, filters on the list of sports, groups by word, and provides the number of occurrences of each sport in descending order: providing a rough indicator of how much of the book is dedicated to each sport, all in a few minutes of coding. As someone who codes a lot in ruby, I have a high bar for 'developer happiness', but say without hesitation that R and its tidyverse are joy: expressive (almost always read left to right, top to bottom - just like the prose of a book), fast, reliable, succinct, and productive. For anyone put off by R's indexing starting at 1 rather than 0, or by use of <- instead of = for assignment, I encourage you to suspend your hesitation for a short while to discover the tidyverse: you may well discover it to be a pure joy. [1] https://i.imgur.com/E64yF4Y.png [2] https://pastebin.com/Danc9KNr

Share card

Actual performance

1points
1comments
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Strong signals: started · Missing: supports, reddit linkedin, podcasting
78%78% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Hacker NewsStrong engagement from HN community · Strong signals: ide, io · Missing: https docs, excited, just released
57%57% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
39%39% predicted probability of success on AppSumo, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: way · Missing: mobile apps, ios, personal
36%36% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Product HuntUnlikely to reach the leaderboard · Strong signals: slack, new, coding · Missing: mac, agents, macos
36%36% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
18%18% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

Mo
Monty Hall problem, with 30 doors45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Monty Hall problem, with 30 doors

Hacker News3
Sp
Spinlock in 30 Lines of C54%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Spinlock in 30 Lines of C

Hacker News1
Ow
Own MobX in 65 lines of code51%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Own MobX in 65 lines of code

Hacker News12
Im
Implement MFA in two lines of code58%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Implement MFA in two lines of code

Hacker News8
30
30 vs. 3000 lines of code for very simple MEAN app40%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

30 vs. 3000 lines of code for very simple MEAN app

Hacker News12
Bu
Build a Video RAG under 30 lines of code49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Build a Video RAG under 30 lines of code

Hacker News6
Go
Go-dutchflag – An implementation of the Dutch flag problem in Golang37%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Go-dutchflag – An implementation of the Dutch flag problem in Golang

Hacker News3
Th
The AZ Problem39%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

The AZ Problem

Hacker News2
So
Someone Else's Problem39%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Someone Else's Problem

Hacker News1
Th
The problem with the epsilon greedy method33%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

The problem with the epsilon greedy method

Hacker News22