jd2504 / fivethirtyeight

R package of data and code behind the stories and interactives at FiveThirtyEight

Home Page:https://github.com/fivethirtyeight/data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fivethirtyeight

Build Status CRAN_Status_Badge CRAN RStudio mirror downloads

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.

Installation & Usage

Get the released version from CRAN:

install.packages("fivethirtyeight")

Or the development version from GitHub:

# If you haven't installed devtools yet, do so:
# install.packages("devtools")
devtools::install_github("rudeboybert/fivethirtyeight")

Example usage:

library(fivethirtyeight)
data(package = "fivethirtyeight")

# Bechdel data set:
data(bechdel)
head(bechdel)
?bechdel
# If using RStudio:
View(bechdel)

More Information

See the package vignette for:

  1. Our motivation for creating this package.
  2. Guidelines we followed preparing the data sets and links to the code.
  3. A more detailed outline of all data sets.
vignette("fivethirtyeight", package = "fivethirtyeight")

Collaborate

Code

In many instances, the data sets had the R code used in the analysis. We would love to

  1. Convert the code to use tidyverse package tools
  2. Present the code in R Markdown format

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")

Contributing to the Package

If you want to contribute to the package:

  • We followed the principles in Hadley Wickham's R packages book
  • Preliminary instructions for automating R package documentation and collecting data about the data sets is available here.

About

R package of data and code behind the stories and interactives at FiveThirtyEight

https://github.com/fivethirtyeight/data

License:Other


Languages

Language:Jupyter Notebook 49.9%Language:R 40.7%Language:Python 9.4%