Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!