Skip to content

Instantly share code, notes, and snippets.

@cavedave
Last active May 25, 2016 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cavedave/71c7c718c98cdcc1940cd0fd43b7af3b to your computer and use it in GitHub Desktop.
Save cavedave/71c7c718c98cdcc1940cd0fd43b7af3b to your computer and use it in GitHub Desktop.
Use emoGG r package to make ggplot2 scatterplot with soccer ball geom_points
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Year Panels webpage name drag weight
1930 12 http://worldcupballs.info/world-cup-balls/1930-uruguay/1930-world-cup-ball-t-model.html
1934 13 http://worldcupballs.info/world-cup-balls/1934-italy/1934-world-cup-ball-federale-102.html
1938 13 http://worldcupballs.info/world-cup-balls/1938-france/1938-world-cup-ball-allen.html
1950 12 http://worldcupballs.info/world-cup-balls/1950-brazil/1950-world-cup-ball-superball.html
1954 18 http://worldcupballs.info/world-cup-balls/1954-switzerland/1954-world-cup-ball-swiss-world-champion.html
1958 24 http://worldcupballs.info/world-cup-balls/1958-sweden/1958-world-cup-ball-top-star.html
1962 18 http://worldcupballs.info/world-cup-balls/1962-chile/1962-world-cup-ball-crack.html
1966 25 http://worldcupballs.info/world-cup-balls/1966-england/1966-world-cup-ball-slazenger-challenge.html 14 - 16 ounces
1970 32
1974 32
1978 32
1982 32
1986 32
1990 32
1994 32
1998 32
2002 32
2006 14 https://en.wikipedia.org/wiki/Adidas_Teamgeist Teamgeist  2.8 × 105
2008 14 https://en.wikipedia.org/wiki/Adidas_Europass
2010 8 https://en.wikipedia.org/wiki/Adidas_Jabulani Jabulani  3.3 × 105
2012 32 https://en.wikipedia.org/wiki/Adidas_Tango_12 2.4 × 105
2014 6 https://en.wikipedia.org/wiki/Adidas_Brazuca Brazuca
2016 6 https://en.wikipedia.org/wiki/Adidas_Beau_Jeu
library(emoGG)
library(ggplot2)
mydata = read.csv("balls.csv",header=TRUE)
bp <- ggplot(mydata, aes(x=Year, y=Panels)) +
geom_emoji(emoji="26bd")
bp + ggtitle("Number of Panels on Soccer Balls")+
theme(plot.title = element_text(lineheight=1.9, face="bold")) +
theme(plot.margin = unit(c(1,1,1,1), "cm"))
ggsave("balls.png", width = 20, height = 20, units = "cm")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment