#Title: DWV Week 3 Solutions.R
#Author: Jack Reilly
#Purpose: Solve Week 3 Assignment
#Requires: bes2005subset.csv; nes2000subset.csv
#Output: Plots to plot window; nothing to disk

#This file isn't writing anything out, so we're just going to make the working directory the dataset directory
setwd("~/desktop/working/dwv/datasets")

#Read in BES dataset
bes<-read.csv("bes2005subset.csv")

#Plot Blair and Social Spending, with points jittered
plot(jitter(bes$BlairFeelings)~jitter(bes$SocialSpending), main="Opinion of Tony Blair and Social Spending", ylab="Feelings About Blair", xlab="Social Spending")

#Load in `nes2000subset.csv`.
nes<-read.csv("nes2000subset.csv")

#Correlated and plot partisanship and income
cor(nes$partisanship, nes$income)
plot(jitter(nes$partisanship)~jitter(nes$income), main="Income and Partisanship in the 2000 Election", ylab="Partisanship", xlab="Income")