forked from bcgov/dipr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rprofile
36 lines (33 loc) · 1.2 KB
/
.Rprofile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
if (Sys.getenv("USERDOMAIN") != "POPDATA") {
## Choose cran mirror
local({
r = getOption("repos")
r["CRAN"] = "https://cran.rstudio.com/"
options(repos = r)
})
}
## Re-jig the internal digest:::check_file function to use
## R.utils::fileAccess instead. See the _targets.R for how
## we re-assign the function in the package.
if (Sys.getenv("USERDOMAIN") == "POPDATA") {
library(digest, warn.conflicts = FALSE)
suppressPackageStartupMessages(library(R.utils, warn.conflicts = FALSE))
library(utils)
.custom_check_file <- function (object, errormode) {
if (!file.exists(object)) {
return(.errorhandler("The file does not exist: ",
object, mode = errormode))
}
if (!isTRUE(!file.info(object)$isdir)) {
return(.errorhandler("The specified pathname is not a file: ",
object, mode = errormode))
}
if (suppressWarnings(R.utils::fileAccess(object, 4))) {
return(.errorhandler("The specified file is not readable: ",
object, mode = errormode))
}
}
reassignInPackage("check_file", "digest", .custom_check_file)
}
## Silence a CRAN warning
Sys.setenv('_R_CHECK_SYSTEM_CLOCK_' = 0)