knitr::opts_chunk$set(echo = TRUE)

This package contains only datasets---the tidy datasets for POS 5737 found on the data page of the course website.

Quick Start

# install package
devtools::install_github("pos5737/pos5737data")

# see datasets
help(package = "pos5737data")

# load data
data(parties, package = "pos5737data")

Contributing

New datasets require the following:

Motivation

In the usual workflow, one might download the data file parties.rds into the data/ directory. They might load the data with

parties <- readr::read_rds("data/parties.rds)

This package allows you to skip the download step.

Usage

Installing the Package

To install the package, run

devtools::install_github("pos5737/pos5737data")

You only need to run this once.

Loading the Data

Once you have the package installed on your computer, you can load the datasets with

# load data
data(parties, package = "pos5737data")

Alternatively, you can use

# load packages
library(pos5737data)

# load data
data("parties")

To see the available datasets, use

help(package = "pos5737data")

Example

parties: Clark and Golder (2006)

# load packages
library(tidyverse)
library(broom)

# load data
data(parties, package = "pos5737data")

# regression model from their table 2, pooled analysis, whole sample
fit <- lm(enep ~ log(average_magnitude)*eneg + upper_tier*eneg + 
            en_pres*proximity, 
          data = parties)

# create table
texreg::screenreg(fit)

therms: ANES Feeling Thermometers

# load data
data(therms)

ggplot(therms, aes(x = ft_democratic_party, y = ft_republican_party)) +
  geom_point()

anscombe

data(anscombe, package = "pos5737data")

ggplot(anscombe, aes(x = x, y = y)) + 
  geom_point() + 
  facet_wrap(vars(dataset))


pos5737/pos5737data documentation built on Nov. 5, 2019, 1 a.m.