-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathzzz.R
More file actions
17 lines (17 loc) · 831 Bytes
/
zzz.R
File metadata and controls
17 lines (17 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.onAttach <- function(lib, pkg) {
tryCatch(
{
git_version <- suppressWarnings(read.table("https://raw.githubusercontent.com/doehm/survivoR/master/inst/version-git.txt")[1,1])
# git_version <- "2.0.6"
git <- as.numeric(strsplit(git_version, "\\.")[[1]])
sys_version <- as.character(utils::packageVersion("survivoR"))
sys <- as.numeric(strsplit(sys_version, "\\.")[[1]])
if(any(git - sys > 0)) {
msg1 <- paste0("Package version on Git (", git_version, ") is ahead of system version (", sys_version, ")\n")
msg2 <- "Install from Git for the latest data - devtools::install_github('doehm/survivoR')"
packageStartupMessage(paste0(msg1, msg2))
}
},
error = function(e) message("Head to https://github.com/doehm/survivoR to check for the latest data")
)
}