Election Data Frame
Errors in the original data set: a missing comma between Marco and Carly in Name, I fixed the spelling of Berine to Bernie, a missing comma between 62 and 51 in ABC, quotation marks around names had to be changed to " ", the variable names for ABC and CBS political poll results had spaces, which I changed to _.
After fixing all the errors in the data set, I used the three variables Name, ABC_political_poll_results, and CBS_political_poll_results to create the data frame. Since the data set is based on the 2016 presidential election, I named the data frame election_2016. Here is my corrected code in R:
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)
election_2016 <- data.frame(Name, ABC_political_poll_results, CBS_political_poll_results)
election_2016
After running the data frame, my result was:

Comments
Post a Comment