LIS 4370 - Module #3 Data Frame

 

Module #3 Data Frame


The dataset showed hypothetical results of the 2016 Presidential campaign. The dataset provided had a couple of mistakes that resulted in errors.

Original Code:

> Name <- c("Jeb", “Donald”, "Ted”, “Marco” “Carly”, “Hillary”, “Berine”)


> ABC political poll results <- c(4, 62 51, 21, 2, 14, 15)


> CBS political poll results <- c(12, 75, 43, 19, 1, 21, 19) 


There are missing commas in the "Name" vector, as well as in the "ABC political poll results" vector. Additionally, the names of the results vectors were not underscored, therefore they could not be interpreted in R.

For the values to be interpreted, the code should look as follows:


Modified Code:

> Name <- c("Jeb", "Donald", "Ted", "Marco", "Carly", "Hillary", "Bernie")


> ABC_political_poll_results <- c(4, 62, 51, 21, 2, 14, 15)


> CBS_political_poll_results <- c(12, 75, 43, 19, 1, 21, 19)


Donald Trump is leading by a wide margin, according to polls conducted by CBS and ABC. He is receiving 62% of the vote in the ABC survey and 75% in the CBS poll. These findings imply a substantial preference for Donald Trump that has persisted throughout the two surveys.

With 51% of ABC voters and 43% of CBS voters, Ted Cruz has a sizable lead in both surveys. There is a clear difference between him and Donald Trump, even if he is ranked second in both polls.

With 14% in the ABC poll and 21% in the CBS poll, Hillary Clinton is the front-runner for the Democratic nomination. But compared to the front-runner Republican, Donald Trump, her support is much lower.

In both polls, the percentages of support for other contenders (Jeb, Marco, Carly, and Bernie) are lower. Though the percentages for each candidate vary, there is generally some consistency between the two surveys.

Comments

Popular posts from this blog

LIS 4370: Module # 10 Building your own R package

LIS 4317 Final Project: Fuel Economy Data from the U.S Dept. of Energy

LIS 4317: Module # 10 assignment