Total <- eb[,1:3] colnames(Total) <- c("date", "cases", "deaths") Total1<- melt(Total) Total1$country<-rep("Total",2*nrow(Total)) Guinea<- eb[, c(1,4,5)] colnames(Guinea) <- c("date", "cases", "deaths") Guinea1<- melt(Guinea) Guinea1$country<-rep("Guinea",2*nrow(Guinea)) Liberia<-eb[, c(1,6,7)] colnames(Liberia) <- c("date", "cases", "deaths") Liberia1<- melt(Liberia) Liberia1$country<-rep("Liberia",2*nrow(Liberia)) Sierra_Leone <-eb[, c(1,8,9)] colnames(Sierra_Leone) <- c("date", "cases", "deaths") Sierra_Leone1<-melt(Sierra_Leone) Sierra_Leone1$country<-rep("Sierra_Leone",2*nrow(Sierra_Leone)) Nigeria<-eb[, c(1,10,11)] colnames(Nigeria) <- c("date", "cases", "deaths") Nigeria1<-melt(Nigeria) Nigeria1$country<-rep("Nigeria",2*nrow(Nigeria)) Senegal<-eb[, c(1,12,13)] colnames(Senegal) <- c("date", "cases", "deaths") Senegal1<-melt(Senegal) Senegal1$country<-rep("Senegal",2*nrow(Senegal)) ebola<-rbind(Total1,Guinea1,Liberia1,Sierra_Leone1,Nigeria1,Senegal1)
|