I'm trying to create a table in which the headers can change from time to time which means that the headers are not static.
Kindly see the sample below.
Create variable months with the code below
testing<-format(Sys.Date(),"%m")
testing<-as.integer(testing)
testing<-testing -(2)
last_2_month<-month.name[testing]
teaser<-format(Sys.Date(),"%m")
teaser<-as.integer(teaser)
teaser<-teaser-1
last.month<-month.name[teaser]
creating table
Point <- c("Average success rate", "Average processing duration", "Average daily count", "Total count processed")
ss <- c(23, 41, 32, 58)
sss <- c("Jon", "Bill", "Maria", "Ben")
dframes <- data.frame(Point,last.month,last_2_month) #creating table the table
what I want is that the variable for both last.month
and last_2_month
should display the true month name/variable eg January and February in the table
Point | January | Feburary |
---|---|---|
Average success rate | CSW | Data |
Average processing duration | CSW | Data |
Average daily count | CSW | Data |
Total count processed | CSW | Data |
Glo CSW Data