0

I have a time series data of daily cases against time. I have grouped the data against month and changed the month variable using months function into January, February, etc. Now when I plot the box plot of the daily cases against the month variable, the plot gets aligned alphabetically instead chronologically.

Box Plot

Here is the data used to plot.

The following code I used.

y<-read.csv('COVID.csv',row.names=1)
y$Date<-as.Date(row.names(y),'%d-%m-%Y')
row.names(y)<-NULL
y<-y%>%group_by(month=floor_date(Date,unit='month'))
y$month<-months(y$month)
boxplot(y$Daily.Cases~y$month)

Here is the dataset

I tried the solution and it gave the following graph

As you can see, I don't have any data for the month of November and December but it's showing up in the graph.

0 Answers0