An R package that provides access to the code and data sets published by FiveThirtyEight https://github.com/fivethirtyeight/data. Note that while we received guidance from editors at 538, this package is not officially published by 538.
Get the released version from CRAN:
Or the development version from GitHub:
# If you haven't installed devtools yet, do so: # install.packages("devtools") devtools::install_github("rudeboybert/fivethirtyeight")
library(fivethirtyeight) # Bechdel data set (note that data is lazy loaded so one can also just access `bechdel` without running `data(bechdel)`): data(bechdel) head(bechdel) ?bechdel # If using RStudio: View(bechdel) # To see a list of all data sets: data(package = "fivethirtyeight") # To see a more detailed list of all data sets, see the package vignette: vignette("fivethirtyeight", package = "fivethirtyeight")
For some data sets, there is an example analysis in a package vignette. For example, we did this using the R code for the article The Dollar-And-Cents Case Against Hollywood’s Exclusion of Women here:
vignette("bechdel", package = "fivethirtyeight")
For a complete list of vignettes run:
browseVignettes(package = "fivethirtyeight")
bechdelvignette during his rstudio::conf talk in Orlando, Florida in January. The video of his talk is available here.
vignette("fivethirtyeight", package = "fivethirtyeight")
In many instances, the data sets on the original 538 GitHub repository had the R code used in the analysis. We would love to have these, or any other interesting analyses, in the form of package vignettes. We ask you follow these guidelines as much as possible: