Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For instance, in 2 0 0 8 , typically red states - including North Carolina, Indiana, and Virginia - helped elect Barack Obama to the

For instance, in 2008, typically red states-including North Carolina, Indiana, and Virginia-helped elect Barack Obama to the presidency.
In this exercise, we will again map the US presidential election results for 48 states.
However, our data will be more detailed in two respects. First, we will analyze data from 14 presidential elections from 1960 to 2012, allowing us to visualize how the geography of party choice has changed over time. Second, we will examine election results at the county level, allowing us to explore the spatial distribution of Democratic and Republican voters within states. The data file is available in CSV format as elections.cv. Each row of the data set represents the distribution of votes in that year's presidential election from each county in the United States. Table 5.8 presents the names and descriptions of variables in this data set.
1. We begin by visualizing the outcome of the 2008 US presidential election at the county level. Begin with Massachusetts and Arizona and visualize the county-level outcome by coloring counties based on the two-party vote share as done in section 5.3.4. The color should range from pure blue (100% Democratic) to pure red (100% Republican) using the RGB color scheme. Use the county database in the maps package. The regions argument of the map () function enables us to specify the state and county. The argument accepts a character vector, each entry of which has the syntax state, county. Provide a brief comment.
2. Next, using a loop, visualize the 2008 county-level election results across

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions