[Genabel-commits] r834 - in pkg/GenABEL: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Dec 20 21:03:12 CET 2011


Author: yurii
Date: 2011-12-20 21:03:11 +0100 (Tue, 20 Dec 2011)
New Revision: 834

Modified:
   pkg/GenABEL/CHANGES.LOG
   pkg/GenABEL/DESCRIPTION
   pkg/GenABEL/R/zzz.R
Log:
this version 1.7-0 will be submitted to CRAN

Modified: pkg/GenABEL/CHANGES.LOG
===================================================================
--- pkg/GenABEL/CHANGES.LOG	2011-12-07 15:56:16 UTC (rev 833)
+++ pkg/GenABEL/CHANGES.LOG	2011-12-20 20:03:11 UTC (rev 834)
@@ -1,8 +1,8 @@
-*** v. 1.7-0 (2011.12.05)
+*** v. 1.7-0 (2011.12.20)
 
 Addressed bug [#1383] (message about upgrade on loading the library 
 not entirely correct) by adding new function checkPackageVersionOnCRAN() 
-and re-writing zzz.R using it.  
+and re-writing zzz.R (.onLoad) using it.  
 
 Addressed bug [#1673] (bug in load.gwaa.data and export.merlin when 
 sorting is enabled, filed in by Daniel Taliun), added unit test 

Modified: pkg/GenABEL/DESCRIPTION
===================================================================
--- pkg/GenABEL/DESCRIPTION	2011-12-07 15:56:16 UTC (rev 833)
+++ pkg/GenABEL/DESCRIPTION	2011-12-20 20:03:11 UTC (rev 834)
@@ -2,11 +2,12 @@
 Type: Package
 Title: genome-wide SNP association analysis
 Version: 1.7-0
-Date: 2011-12-05
+Date: 2011-12-20
 Author: GenABEL developers
 Maintainer: GenABEL developers <genabel.project at gmail.com>
 Depends: R (>= 2.10.0), methods, MASS, utils
-Suggests: qvalue, genetics, haplo.stats, DatABEL (>= 0.9-0), hglm, MetABEL, PredictABEL
+Suggests: qvalue, genetics, haplo.stats, DatABEL (>= 0.9-0), 
+	hglm, MetABEL, PredictABEL, VariABEL 
 Description: a package for genome-wide association analysis between 
              quantitative or binary traits and single-nucleotide
              polymorphisms (SNPs). 

Modified: pkg/GenABEL/R/zzz.R
===================================================================
--- pkg/GenABEL/R/zzz.R	2011-12-07 15:56:16 UTC (rev 833)
+++ pkg/GenABEL/R/zzz.R	2011-12-20 20:03:11 UTC (rev 834)
@@ -1,65 +1,64 @@
 .onLoad <- function(lib, pkg) {
-}
-
-setHook(packageEvent("GenABEL", "onLoad"),
-		function() {
-			pkgDescription <- packageDescription(pkg)
-			pkgVersion <- pkgDescription$Version
-			pkgDate <- pkgDescription$Date
-			welcomeMessage <- paste(pkg," v. ",pkgVersion," (",pkgDate,") loaded\n",sep="")
-			# check if CRAN version is the same as loaded
-			cranVersion <- checkPackageVersionOnCRAN(pkg)
-			if (!is.null(cranVersion)) 
-				if (pkgVersion != cranVersion) {
+	## this is something which should be fixed: both version 
+	## and date can come from DESCRIPTION!
+	#pkgDescription <- packageDescription(pkg)
+	#pkgVersion <- pkgDescription$Version
+	#pkgDate <- pkgDescription$Date
+	pkgVersion <- "1.7-0"
+	pkgDate <- "December 20, 2011"
+	welcomeMessage <- paste(pkg," v. ",pkgVersion," (",pkgDate,") loaded\n",sep="")
+	# check if CRAN version is the same as loaded
+	cranVersion <- checkPackageVersionOnCRAN(pkg)
+	if (!is.null(cranVersion)) 
+		if (pkgVersion != cranVersion) {
+			welcomeMessage <- paste(welcomeMessage,
+					"\nInstalled ",pkg," version (",pkgVersion,") is not the same as stable\n",
+					"version available from CRAN (",cranVersion,"). Unless used intentionally,\n",
+					"consider updating to the latest CRAN version. For that, use\n",
+					"'install.packages(\"",pkg,"\")', or ask your system administrator\n",
+					"to update the package.\n\n",sep="")
+		}
+	# check for news
+	address <- c(
+			"http://genabel.r-forge.r-project.org/version_and_news.html",
+			"http://www.genabel.org/sites/default/files/version_and_news.html"
+	)
+	svtmo <- options("timeout")
+	options("timeout"=10)
+	tryRes1 <- 0; class(tryRes1) <- "try-error"
+	curaddr <- 1
+	while (class(tryRes1) == "try-error" && curaddr <= length(address) ) {
+		suppressWarnings(
+				tryRes0 <- try(conn <- url(address[curaddr]),silent=TRUE)
+		)
+		suppressWarnings(
+				tryRes1 <- try(fulltext <- readLines(conn),silent=TRUE)
+		)
+		close(conn)
+		curaddr <- curaddr + 1
+	}
+	if (class(tryRes1) != "try-error") {
+		if (length(fulltext)>0)
+		{
+			# message to all users
+			strnews <- grep("<messagetoall>",tolower(fulltext))
+			endnews <- grep("</messagetoall>",tolower(fulltext))
+			if (length(strnews)>0 && length(endnews)>0) 
+				if ((endnews-1) >= (strnews+1)) {
 					welcomeMessage <- paste(welcomeMessage,
-							"\nInstalled ",pkg," version (",pkgVersion,") is not the same as stable\n",
-							"version available from CRAN (",cranVersion,"). Unless used intentionally,\n",
-							"consider updating to the latest CRAN version. For that, use\n",
-							"'install.packages(\"",pkg,"\")', or ask your system administrator\n",
-							"to update the package.\n\n",sep="")
+							fulltext[(strnews+1):(endnews-1)],sep="\n")
 				}
-			# check for news
-			address <- c(
-					"http://genabel.r-forge.r-project.org/version_and_news.html",
-					"http://www.genabel.org/sites/default/files/version_and_news.html"
-			)
-			svtmo <- options("timeout")
-			options("timeout"=10)
-			tryRes1 <- 0; class(tryRes1) <- "try-error"
-			curaddr <- 1
-			while (class(tryRes1) == "try-error" && curaddr <= length(address) ) {
-				suppressWarnings(
-						tryRes0 <- try(conn <- url(address[curaddr]),silent=TRUE)
-				)
-				suppressWarnings(
-						tryRes1 <- try(fulltext <- readLines(conn),silent=TRUE)
-				)
-				close(conn)
-				curaddr <- curaddr + 1
-			}
-			if (class(tryRes1) != "try-error") {
-				if (length(fulltext)>0)
-				{
-					# message to all users
-					strnews <- grep("<messagetoall>",tolower(fulltext))
-					endnews <- grep("</messagetoall>",tolower(fulltext))
-					if (length(strnews)>0 && length(endnews)>0) 
-						if ((endnews-1) >= (strnews+1)) {
-							welcomeMessage <- paste(welcomeMessage,
-									fulltext[(strnews+1):(endnews-1)],sep="\n")
-						}
-					# check for specific package news
-					strnews <- grep(paste("<",pkg,"news>",sep=""),tolower(fulltext))
-					endnews <- grep(paste("</",pkg,"news>",sep=""),tolower(fulltext))
-					if (length(strnews)>0 && length(endnews)>0) 
-						if ((endnews-1) >= (strnews+1)) {
-							welcomeMessage <- paste(welcomeMessage,
-									fulltext[(strnews+1):(endnews-1)],sep="\n")
-						}
+			# check for specific package news
+			strnews <- grep(paste("<",pkg,"news>",sep=""),tolower(fulltext))
+			endnews <- grep(paste("</",pkg,"news>",sep=""),tolower(fulltext))
+			if (length(strnews)>0 && length(endnews)>0) 
+				if ((endnews-1) >= (strnews+1)) {
+					welcomeMessage <- paste(welcomeMessage,
+							fulltext[(strnews+1):(endnews-1)],sep="\n")
 				}
-				#rm(a,fulltext,ver)
-			}
-			options("timeout"=svtmo)
-			packageStartupMessage(welcomeMessage)
 		}
-) 
+		#rm(a,fulltext,ver)
+	}
+	options("timeout"=svtmo)
+	packageStartupMessage(welcomeMessage)
+}



More information about the Genabel-commits mailing list