rcranstrptime

Troubleshooting CRAN check issue with M1mac and strptime


I got a notification that my R package on CRAN has an issue. I don't get an error on my own machine (an M1 Mac) or on winbuilder tests but CRAN still finds it. https://cran.r-project.org/web/checks/check_results_respirometry.html

The offending code seems to be a call to strptime where a string such as 5/2/2016 6:08:12 PM is parsed with the format '%m/%d/%Y %I:%M:%S %p'. Brian Ripley suggested I follow the examples on the strptime help page:

## read in date info in format 'ddmmmyyyy'
## This will give NA(s) in some non-English locales; setting the C locale
## as in the commented lines will overcome this on most systems.
## lct <- Sys.getlocale("LC_TIME"); Sys.setlocale("LC_TIME", "C")
x <- c("1jan1960", "2jan1960", "31mar1960", "30jul1960")
z <- strptime(x, "%d%b%Y")
## Sys.setlocale("LC_TIME", lct)

So I tried to replicate this in my own code:

lct <- Sys.getlocale("LC_TIME")
Sys.setlocale("LC_TIME", "C")
f$TIME = strptime(f$TIME, format = date)
Sys.setlocale("LC_TIME", lct)

But I still get the same issue. Any ideas what's wrong?


Solution

  • I guess this is something weird on CRAN's end. I got this email this morning from CRAN:

    Thanks, reverse dependency checks have been triggered.
    You fixed it, the report you got talked about the current CRAN release. As not all addition issues checks are automated yet, we send that mail before proceeeding.