Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R cmd check note: unable to verify current time

Tags:

r

When running R CMD check I get the following note:

checking for future file timestamps ... NOTE
  unable to verify current time

I have seen this discussed here, but I am not sure which files it is checking for timestamps, so I'm not sure which files I should look at. This happens locally on my windows and remotely on different systems (using github actions).

like image 656
J.C.Wahl Avatar asked Aug 27 '20 09:08

J.C.Wahl


2 Answers

Take a look at https://svn.r-project.org/R/trunk/src/library/tools/R/check.R The check command relies on an external web resource:

now <- tryCatch({
foo <- suppressWarnings(readLines("http://worldclockapi.com/api/json/utc/now",
                                 warn = FALSE))

This resource http://worldclockapi.com/ is currently not available.

Hence the following happens (see same package source):

if (is.na(now)) {
   any <- TRUE
   noteLog(Log, "unable to verify current time")

See also references: https://community.rstudio.com/t/r-devel-r-cmd-check-failing-because-of-time-unable-to-verify-current-time/25589

So, unfortunately this requires a fix in the check function by the R development team ... or the web-resource coming online again.

like image 78
qasta Avatar answered Nov 16 '22 21:11

qasta


To add to qasta's answer, you can silence this check by setting the _R_CHECK_SYSTEM_CLOCK_ environment variable to zero e.g Sys.setenv('_R_CHECK_SYSTEM_CLOCK_' = 0)

To silence this in a persistent manner, you can set this environment variable on R startup. One way to do so is through the .Renviron file, in the following manner:

  1. install.packages("usethis") (If not installed already)
  2. usethis::edit_r_environ()
  3. Add _R_CHECK_SYSTEM_CLOCK_=0 to the file
  4. Save, close file, restart R
like image 37
Paul Wildenhain Avatar answered Nov 16 '22 22:11

Paul Wildenhain