Skip to content

Instantly share code, notes, and snippets.

View rohfosho's full-sized avatar
👾

Rohith Varanasi rohfosho

👾
View GitHub Profile
#look at vote share for each state and how Fox News affects it
vote.share.per.state <- rep(NA, 51) # initialize a vector place holder
## state names which the loop will iterate through
st.names <- unique(Fox$state)
## add labels for easy interpretation later on
names(vote.share.per.state) <- as.character(st.names)
## loop across 50 states plus DC
for (i in 1:51){
## subset the ith state