Uploaded October 2019 | Updated November 2026, 2 hours ago
Bar race chart showing Major League Baseball team records for most home runs hit in a season over time. Inspired by the home run race between the Twins and Yankees this season and the start of the MLB playoffs where these two all-time best home run hitting teams will square off in the first round. It turns out 2019 wasn't the only time that the Twins and Yankees held the #1 and #2 spots on the team record list for home runs hit in a season.
Note the lull in new records during the "dead-ball era" of 1900-1919 and the relative frequency of new records during the Babe Ruth era of the 1920's and the power hitting era of the late 1990's. Also note that 6 of the top 10 records for home runs hit in a season by a team over the past ~148 years occurred this year!
I will create more original data viz in the future if people like this.
Subscribe on YouTube and follow on social media to get updates and support the channel:
Twitter: twitter.com/DataDaft
Discord (new): discord.gg/ZS2yPNw
Tools Used:
R, MovieMaker, flourish.studio (https://flourish.studio/ )
Sources:
Data: Baseball Databank 2018 - seanlahman.com/baseball-archive/statistics
ESPN (2019 HR Totals) - espn.com/mlb/stats/team/_/stat/batting/seasontype/2
Logos: sportslogos.net - sportslogos.net/teams/list_by_year/42018/2018_MLB_Logos
Music: "Take Me Out To The Ball Game" 1908 Recording by Ed Meeker (Public Domain) -archive.org/details/TakeMeOutToTheBallGame_243
#MLB #mlbplayoffs
Bar race chart showing Major League Baseball team records for most home runs hit in a season over time. Inspired by the home run race between the Twins and Yankees this season and the start of the MLB playoffs where these two all-time best home run hitting teams will square off in the first round. It turns out 2019 wasn't the only time that the Twins and Yankees held the #1 and #2 spots on the team record list for home runs hit in a season.
Note the lull in new records during the "dead-ball era" of 1900-1919 and the relative frequency of new records during the Babe Ruth era of the 1920's and the power hitting era of the late 1990's. Also note that 6 of the top 10 records for home runs hit in a season by a team over the past ~148 years occurred this year!
I will create more original data viz in the future if people like this.
Subscribe on YouTube and follow on social media to get updates and support the channel:
Twitter: twitter.com/DataDaft
Discord (new): discord.gg/ZS2yPNw
Tools Used:
R, MovieMaker, flourish.studio (https://flourish.studio/ )
Sources:
Data: Baseball Databank 2018 - seanlahman.com/baseball-archive/statistics
ESPN (2019 HR Totals) - espn.com/mlb/stats/team/_/stat/batting/seasontype/2
Logos: sportslogos.net - sportslogos.net/teams/list_by_year/42018/2018_MLB_Logos
Music: "Take Me Out To The Ball Game" 1908 Recording by Ed Meeker (Public Domain) -archive.org/details/TakeMeOutToTheBallGame_243
#MLB #mlbplayoffs








![How to Reverse Data in R
This video shows how to reverse vectors, strings and data frames by both columns and rows in R.
Code used in this clip:
# Reverse a vector
v <- c(Reverse, Me)
rev(v)
# Reverse a character string with stringi
library(stringi)
stri_reverse(Reverse Me)
# Reverse the columns of a data frame
data <- mtcars
head(data)
reversed_columns <- data[, rev(names(data))]
head(reversed_columns)
# Reverse the rows of a data frame
tail(data)
reversed_rows <- data[rev(1:nrow(data)), ]
head(reversed_rows)
Code Clips are basic code explanations in 3 minutes or less. They are intended to be short reference guides that provide quick breakdowns and copy/paste access to code needed to accomplish common data science tasks. Think Stack Overflow with a video explanation.
* Note: YouTube does not allow greater than or less than symbols in the text description, so the code above will not be exactly the same as the code shown in the video! For R that means I may use = for assignment and the special Unicode large < and > symbols in place of the standard sized ones for dplyr pipes and comparisons. These special symbols should work as expected for R code on Windows, but may need to be replaced with standard greater than and less than symbols for other operating systems. How to Reverse Data in R](https://i.ytimg.com/vi/TqFG0TpZVSg/mqdefault.jpg)

