anhoej / qicharts2

R package: Quality improvement charts
36 stars 12 forks source link

Error with X-axis and Dates #3

Closed jdtanner closed 6 years ago

jdtanner commented 6 years ago

Hello,

Using the following code:

library(qicharts2) Test <- read.csv('/home/jdtanner/Documents/Test.csv',head=TRUE,sep=",",stringsAsFactors = FALSE) Test$Date <- as.Date(Test$Date,"%d/%m/%y") qic(Date, Incidents, chart='run',data=Test, title='Incident QIC', ylab='Incident Count', xlab='Date',decimals=0,x.format="%d/%m/%y",x.angle=45)

With the following data in Test.csv:

Date,Incidents 27/11/17,241 26/11/17,228 25/11/17,286 24/11/17,285 23/11/17,267 22/11/17,293 21/11/17,298 20/11/17,217 19/11/17,313 18/11/17,327 17/11/17,262 16/11/17,294 15/11/17,289 14/11/17,274 13/11/17,205 12/11/17,290 11/11/17,303 10/11/17,262 09/11/17,288 08/11/17,245 07/11/17,246 06/11/17,233 05/11/17,288 04/11/17,309 03/11/17,279 02/11/17,265 01/11/17, 31/10/17,273 30/10/17,249 29/10/17,310 28/10/17,306 27/10/17,295 26/10/17,271 25/10/17,299

Yields a graph (as attached) with an incorrect x-axis. The final date value on the x-axis should be the latest date, but it is one day out; this is the same for all of the data.

Any ideas? John rplot

anhoej commented 6 years ago

Fixed. Please test and report. The bug seemed to be triggered when dates changed from summer to winter time.