This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
# constructing the data set
# this is week78 assignment for IS 607. Colloboratively done by Muthukumar and Rajagopal
response=c("Yes","No")
Edin1624=c(80100,35900)
Edin25plus=c(143000,214800)
Glass1624=c(99400,43000)
Glass25plus=c(150400,207400)
MuthuRaj.week78<- data.frame(response, Edin1624,Edin25plus,Glass1624,Glass25plus, stringsAsFactors = FALSE)
MuthuRaj.week78
## response Edin1624 Edin25plus Glass1624 Glass25plus
## 1 Yes 80100 143000 99400 150400
## 2 No 35900 214800 43000 207400
###load tidyr and dplyr
library(tidyr)
library(dplyr)
##
## Attaching package: 'dplyr'
##
## The following object is masked from 'package:stats':
##
## filter
##
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
MuthuRaj.tidy<-gather(MuthuRaj.week78,key,"NoVotes",Edin1624:Edin25plus)
MuthuRaj.tidy
## response Glass1624 Glass25plus key NoVotes
## 1 Yes 99400 150400 Edin1624 80100
## 2 No 43000 207400 Edin1624 35900
## 3 Yes 99400 150400 Edin25plus 143000
## 4 No 43000 207400 Edin25plus 214800