ddediu / AdhereR

Computation of adherence to medications from Electronic Healthcare Data in R
26 stars 6 forks source link

Change to c.Date in new version of R #127

Closed ddediu closed 4 years ago

ddediu commented 4 years ago

From Kurt Hornik Kurt.Hornik@wu.ac.at

Dear maintainer,

Pls see https://CRAN.R-project.org/web/checks/check_results_AdhereR.html.

The errors with r-devel are from a recent change to c.Date which now reasonably coerces all arguments to Date.

In your case, the error is from

9: c.Date(cma$data$.DATE.as.Date, ifelse(!is.null(event.info), cma$data$.OBS.START.DATE, NA), ifelse(!is.null(event.info), cma$data$.FU.START.DATE, NA)) 8: c(cma$data$.DATE.as.Date, ifelse(!is.null(event.info), cma$data$.OBS.START.DATE, NA), ifelse(!is.null(event.info), cma$data$.FU.START.DATE, NA)) 7: plot.CMA0(cma0, patients.to.plot = c("1", "2")) 6: plot(cma0, patients.to.plot = c("1", "2")) at Rex3bc2375a3e44e#23

where c.Date() gets called with

[[1]] [1] "2033-04-26" "2033-07-04" "2033-08-03" "2033-08-17" "2033-10-13" [6] "2033-10-16" "2033-11-23" "2034-01-19" "2034-02-08" "2034-03-08" [11] "2034-04-08" "2034-05-10" "2034-05-29" "2034-06-28" "2034-07-19" [16] "2034-08-31" "2034-09-14" "2034-11-03" "2034-12-01" "2035-01-04" [21] "2035-01-21" "2035-02-10" "2035-03-22" "2035-03-31" "2036-01-20" [26] "2036-03-10" "2036-08-01" "2036-08-01" "2036-09-21" "2037-01-24" [31] "2037-04-16" "2037-05-08"

[[2]] [1] 23156

[[3]] [1] 23126

and as.Date does not know how to coerce the latter two to Date without an origin (presumably intended as 1970-01-01).

Can you pls fix as necessary?

Please correct before 2020-05-15 to safely retain your package on CRAN.

Best -k

ddediu commented 4 years ago

apparently, I removed this code when thoroughly re-writing the plotting...