Module # 3 Data.frame

Module # 3 Data.frame


The data set below is based on the presidential election during 2016, where it outlined the name of the candidate, the source of the poll (ABC vs, CBS). Discuss your result in your blog. Important note, I made up this data, so this data does not reflect what really happened in the election. 


> 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) 


When pasting this data into Rstudio, there were a few syntax errors that needed to be fixed. A comma needed to be added between 62 and 51. ABC political poll results and CBS political poll results need to have underscores. Lastly, The proper parenthesis need to be used for the politicians names. After performing corrections, I was able to receive the right values without error. 


After receiving the right values, I wanted to to merge the data sets into a data frame. I created the the data frame "Presidential_election_poll_results". Below are the results of the data frame. 



From this data frame, we are able to see the difference in values based off the various sources. For example, we can see that Bernie has 15 polls under ABC while having 19 polls under CBS. 




My github

or 

https://github.com/AlenjaksAbraham/LIS4370.git


My github has a repository under LIS4370.  I pushed a Module 3 Data.frame.R and Module 3 R Makrdown.Rmd. With this, you are able to see my code. 



Comments

Popular posts from this blog

Module # 7 R Object: S3 vs. S4 assignment

Module # 10 Building your own R package

Module # 9 Visualization in R