diff --git a/DESCRIPTION b/DESCRIPTION index dac5a87..507812e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: alspac Title: Data dictionary for ALSPAC Description: Functions to search and extract variables based on keywords from the ALSPAC data dictionary -Version: 0.44.0 +Version: 0.44.1 Authors@R: c(person("Gibran", "Hemani", email = "g.hemani@bristol.ac.uk", role = c("aut", "cre")), person("Matthew", "Suderman", email = "matt.suderman@bristol.ac.uk", diff --git a/R/zzz.r b/R/zzz.r index 2439759..af226b1 100644 --- a/R/zzz.r +++ b/R/zzz.r @@ -4,10 +4,24 @@ message("This may lead to slightly different formatting compared to previously.") message("See also the new createDictionary function.") + a <- suppressWarnings(try(readLines("https://raw.githubusercontent.com/explodecomputer/alspac/master/DESCRIPTION"), silent=TRUE)) + + if(!inherits(a, 'try-error')) + { + latest <- gsub("Version: ", "", a[grep("Version", a)]) + current = utils::packageDescription('alspac') + + test <- utils::compareVersion(latest, current$Version) + if(test == 1) + { + packageStartupMessage("\nWarning:\nYou are running an old version of the R/alspac package.\n", + "This version: ", current$Version, "\n", + "Latest version: ", latest, "\n", + "Please consider updating using remotes::install_github('explodecomputer/alspac')") + } + } + loadDictionaries() tryCatch(setDataDir(), error=function(e) print(e$message)) } - - -