Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
20 changes: 17 additions & 3 deletions R/zzz.r
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}