r-gregmisc-users Mailing List for R gregmisc package (Page 23)
Brought to you by:
warnes
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(12) |
Apr
(5) |
May
(3) |
Jun
(5) |
Jul
(2) |
Aug
(5) |
Sep
(7) |
Oct
(15) |
Nov
(34) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(3) |
Feb
(16) |
Mar
(28) |
Apr
(5) |
May
|
Jun
(5) |
Jul
(9) |
Aug
(50) |
Sep
(29) |
Oct
(9) |
Nov
(25) |
Dec
(7) |
2008 |
Jan
(6) |
Feb
(4) |
Mar
(5) |
Apr
(8) |
May
(26) |
Jun
(11) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(9) |
2009 |
Jan
|
Feb
(1) |
Mar
|
Apr
(2) |
May
(26) |
Jun
|
Jul
(10) |
Aug
(6) |
Sep
|
Oct
(7) |
Nov
(3) |
Dec
(2) |
2010 |
Jan
(45) |
Feb
(11) |
Mar
|
Apr
(1) |
May
(8) |
Jun
(7) |
Jul
(3) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(9) |
Dec
(1) |
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(14) |
Sep
(29) |
Oct
(3) |
Nov
|
Dec
(3) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
(6) |
Jun
(59) |
Jul
|
Aug
(8) |
Sep
(21) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
(10) |
Apr
|
May
(18) |
Jun
(25) |
Jul
(18) |
Aug
(1) |
Sep
(6) |
Oct
(28) |
Nov
(4) |
Dec
(13) |
2014 |
Jan
(7) |
Feb
(5) |
Mar
(4) |
Apr
(36) |
May
(3) |
Jun
(7) |
Jul
(46) |
Aug
(14) |
Sep
(12) |
Oct
(2) |
Nov
|
Dec
(12) |
2015 |
Jan
(4) |
Feb
|
Mar
|
Apr
(80) |
May
(36) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <wa...@us...> - 2010-11-12 02:59:36
|
Revision: 1458 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1458&view=rev Author: warnes Date: 2010-11-12 02:59:29 +0000 (Fri, 12 Nov 2010) Log Message: ----------- Update reference test output for TestUnnamedComponents.R Modified Paths: -------------- trunk/SASxport/tests/TestUnnamedComponents.Rout.save Modified: trunk/SASxport/tests/TestUnnamedComponents.Rout.save =================================================================== --- trunk/SASxport/tests/TestUnnamedComponents.Rout.save 2010-11-12 02:51:19 UTC (rev 1457) +++ trunk/SASxport/tests/TestUnnamedComponents.Rout.save 2010-11-12 02:59:29 UTC (rev 1458) @@ -1,7 +1,8 @@ -R version 2.11.1 (2010-05-31) +R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 +Platform: i386-apple-darwin9.8.0/i386 (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -17,7 +18,7 @@ > library(SASxport) -Loaded SASxport version 1.2.3 (2008-02-29). +Loaded SASxport version 1.2.4 (2010-11-11). Updates and technical support available from Random Technologies, LLC <http://random-technologies-llc.com/products/SASxport> @@ -91,6 +92,29 @@ rd.xpr> ## Don't show: rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) + +rd.xpr> ## End Don't show +rd.xpr> +rd.xpr> +rd.xpr> ## Not run: +rd.xpr> ##D ## The Hmisc library provides many useful functions for interacting with +rd.xpr> ##D ## data imported from SAS via read.xport() +rd.xpr> ##D library(Hmisc) +rd.xpr> ##D +rd.xpr> ##D describe(w$test) # see labels, format names for dataset test +rd.xpr> ##D lapply(w, describe)# see descriptive stats in more detaiil for each variable +rd.xpr> ##D +rd.xpr> ##D contents(w$test) # another way to see variable attributes +rd.xpr> ##D lapply(w, contents)# show contents of individual items in more detail +rd.xpr> ##D +rd.xpr> ##D options(digits=7) # compare the following matrix with PROC MEANS output +rd.xpr> ##D t(sapply(w$z, function(x) +rd.xpr> ##D c(Mean=mean(x),SD=sqrt(var(x)),Min=min(x),Max=max(x)))) +rd.xpr> ## End(Not run) +rd.xpr> +rd.xpr> +rd.xpr> +rd.xpr> > write.xport(w$test,file="a.xpt") #1.a Warning message: In write.xport(w$test, file = "a.xpt") : @@ -1452,6 +1476,29 @@ rd.xpr> ## Don't show: rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) + +rd.xpr> ## End Don't show +rd.xpr> +rd.xpr> +rd.xpr> ## Not run: +rd.xpr> ##D ## The Hmisc library provides many useful functions for interacting with +rd.xpr> ##D ## data imported from SAS via read.xport() +rd.xpr> ##D library(Hmisc) +rd.xpr> ##D +rd.xpr> ##D describe(w$test) # see labels, format names for dataset test +rd.xpr> ##D lapply(w, describe)# see descriptive stats in more detaiil for each variable +rd.xpr> ##D +rd.xpr> ##D contents(w$test) # another way to see variable attributes +rd.xpr> ##D lapply(w, contents)# show contents of individual items in more detail +rd.xpr> ##D +rd.xpr> ##D options(digits=7) # compare the following matrix with PROC MEANS output +rd.xpr> ##D t(sapply(w$z, function(x) +rd.xpr> ##D c(Mean=mean(x),SD=sqrt(var(x)),Min=min(x),Max=max(x)))) +rd.xpr> ## End(Not run) +rd.xpr> +rd.xpr> +rd.xpr> +rd.xpr> > write.xport(list=base::list(w$test,w$z),file="a.xpt") #11.a Warning message: In write.xport(list = base::list(w$test, w$z), file = "a.xpt") : @@ -1667,6 +1714,29 @@ rd.xpr> ## Don't show: rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) + +rd.xpr> ## End Don't show +rd.xpr> +rd.xpr> +rd.xpr> ## Not run: +rd.xpr> ##D ## The Hmisc library provides many useful functions for interacting with +rd.xpr> ##D ## data imported from SAS via read.xport() +rd.xpr> ##D library(Hmisc) +rd.xpr> ##D +rd.xpr> ##D describe(w$test) # see labels, format names for dataset test +rd.xpr> ##D lapply(w, describe)# see descriptive stats in more detaiil for each variable +rd.xpr> ##D +rd.xpr> ##D contents(w$test) # another way to see variable attributes +rd.xpr> ##D lapply(w, contents)# show contents of individual items in more detail +rd.xpr> ##D +rd.xpr> ##D options(digits=7) # compare the following matrix with PROC MEANS output +rd.xpr> ##D t(sapply(w$z, function(x) +rd.xpr> ##D c(Mean=mean(x),SD=sqrt(var(x)),Min=min(x),Max=max(x)))) +rd.xpr> ## End(Not run) +rd.xpr> +rd.xpr> +rd.xpr> +rd.xpr> > names(w) <- NULL > w[[3]] <- NULL > write.xport(list=w,file="a.xpt") #12.a @@ -1884,6 +1954,29 @@ rd.xpr> ## Don't show: rd.xpr> SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) + +rd.xpr> ## End Don't show +rd.xpr> +rd.xpr> +rd.xpr> ## Not run: +rd.xpr> ##D ## The Hmisc library provides many useful functions for interacting with +rd.xpr> ##D ## data imported from SAS via read.xport() +rd.xpr> ##D library(Hmisc) +rd.xpr> ##D +rd.xpr> ##D describe(w$test) # see labels, format names for dataset test +rd.xpr> ##D lapply(w, describe)# see descriptive stats in more detaiil for each variable +rd.xpr> ##D +rd.xpr> ##D contents(w$test) # another way to see variable attributes +rd.xpr> ##D lapply(w, contents)# show contents of individual items in more detail +rd.xpr> ##D +rd.xpr> ##D options(digits=7) # compare the following matrix with PROC MEANS output +rd.xpr> ##D t(sapply(w$z, function(x) +rd.xpr> ##D c(Mean=mean(x),SD=sqrt(var(x)),Min=min(x),Max=max(x)))) +rd.xpr> ## End(Not run) +rd.xpr> +rd.xpr> +rd.xpr> +rd.xpr> > colnames(w[[2]]) <- rep("", length=ncol(w[[2]])) > write.xport(list=w,file="a.xpt") #13.a Warning message: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-11-12 02:51:25
|
Revision: 1457 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1457&view=rev Author: warnes Date: 2010-11-12 02:51:19 +0000 (Fri, 12 Nov 2010) Log Message: ----------- Update for SASxport release 1.2.4 Modified Paths: -------------- trunk/SASxport/DESCRIPTION trunk/SASxport/inst/ChangeLog trunk/SASxport/inst/NEWS Modified: trunk/SASxport/DESCRIPTION =================================================================== --- trunk/SASxport/DESCRIPTION 2010-11-12 02:45:39 UTC (rev 1456) +++ trunk/SASxport/DESCRIPTION 2010-11-12 02:51:19 UTC (rev 1457) @@ -1,8 +1,8 @@ Package: SASxport Type: Package Title: Read and Write SAS XPORT Files -Version: 1.2.3 -Date: 2008-02-29 +Version: 1.2.4 +Date: 2010-11-11 Description: This package provides functions for reading, listing the contents of, and writing SAS xport format files. The functions support reading and writing of either @@ -11,9 +11,7 @@ variables of different data types are stored. Author: Unless otherwise noted, the contents of this package were written by - Gregory R. Warnes <gr...@ra...>, are - Copyright (c) 2007 by Random Technologies LLC - <http://random-technologies-llc.com>, and are provided under the + Gregory R. Warnes <gr...@wa...> and are provided under the terms of the GNU General Public License, version 2.0 or later. -- The files 'ieee2ibm.c' and 'ibm2ieee.c' were extracted from BRL-CAD, @@ -31,8 +29,8 @@ -- The creation of this package was partially funded by Metrum Institute <http://metruminstitute.org>. -Maintainer: Gregory R. Warnes <gr...@ra...> +Maintainer: Gregory R. Warnes <gr...@wa...> License: GPL-2 Depends: R (>= 2.4.0) Imports: chron -URL: http://random-technologies-llc.com, http://metruminstitute.org +URL: http://www.warnes.net, http://metruminstitute.org Modified: trunk/SASxport/inst/ChangeLog =================================================================== --- trunk/SASxport/inst/ChangeLog 2010-11-12 02:45:39 UTC (rev 1456) +++ trunk/SASxport/inst/ChangeLog 2010-11-12 02:51:19 UTC (rev 1457) @@ -1,3 +1,24 @@ +2010-11-12 02:41 warnes + + * [r1455] R/read.xport.R, R/xport.R: Fix bug: 'as.is=TRUE' argument + to read.xport was being ignored. + +2010-11-12 02:36 warnes + + * [r1454] tests/Alfalfa_Test.Rout.save, + tests/TestUnnamedComponents.Rout.save, tests/Theoph.Rout.save, + tests/cars.Rout.save, tests/datetime.xpt, tests/puromycin.xpt, + tests/testDates.Rout.save, tests/testNegative.Rout.save, + tests/testNumeric.Rout.save, tests/test_as_is.R, + tests/test_as_is.Rout.save, tests/test_fields.Rout.save, + tests/xport.Rout.save, tests/xxx.Rout.save: Add test for proper + function of as.is flag to read.xport + +2008-02-29 15:40 warnes + + * [r1245] DESCRIPTION, inst/ChangeLog, inst/NEWS: Update for + release 1.2.3 + 2008-02-29 15:37 warnes * [r1244] man/write.xport.Rd: Correct typo in write.xport man page Modified: trunk/SASxport/inst/NEWS =================================================================== --- trunk/SASxport/inst/NEWS 2010-11-12 02:45:39 UTC (rev 1456) +++ trunk/SASxport/inst/NEWS 2010-11-12 02:51:19 UTC (rev 1457) @@ -1,3 +1,12 @@ +Version 1.2.4 2010-11-11 +------------------------ + +Bug fixes: + +- Fix bug in handling of 'as.is' argument to read.xport ('as.is=TRUE' + was not operating as documented). + + Version 1.2.3 2008-02-29 ------------------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-11-12 02:45:45
|
Revision: 1456 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1456&view=rev Author: warnes Date: 2010-11-12 02:45:39 +0000 (Fri, 12 Nov 2010) Log Message: ----------- Update Greg's email address Modified Paths: -------------- trunk/SASxport/man/SASxport-package.Rd trunk/SASxport/man/read.xport.Rd trunk/SASxport/man/toSAS.Rd trunk/SASxport/man/write.xport.Rd Modified: trunk/SASxport/man/SASxport-package.Rd =================================================================== --- trunk/SASxport/man/SASxport-package.Rd 2010-11-12 02:41:05 UTC (rev 1455) +++ trunk/SASxport/man/SASxport-package.Rd 2010-11-12 02:45:39 UTC (rev 1456) @@ -52,7 +52,7 @@ } \author{ Unless otherwise noted, the contents of this package were written by - Gregory R. Warnes \email{gr...@ra...}, are + Gregory R. Warnes \email{gr...@wa...}, are Copyright (c) 2007 by Random Technologies LLC \cr \url{http://random-technologies-llc.com}, and are provided under the terms of the GNU General Public License, version 2.0 or later. @@ -75,7 +75,7 @@ \url{http://metruminstitute.org}. } \section{Maintainer}{ - Gregory R. Warnes \email{gr...@ra...} + Gregory R. Warnes \email{gr...@wa...} } \section{Support}{ Technical support contracts and other services for R, this package, Modified: trunk/SASxport/man/read.xport.Rd =================================================================== --- trunk/SASxport/man/read.xport.Rd 2010-11-12 02:41:05 UTC (rev 1455) +++ trunk/SASxport/man/read.xport.Rd 2010-11-12 02:45:39 UTC (rev 1456) @@ -94,7 +94,7 @@ variables having customized label formats will be converted to \code{factor} objects with appropriate labels. } -\author{ Gregory R. Warnes \email{gr...@ra...} +\author{ Gregory R. Warnes \email{gr...@wa...} based on \code{Hmisc:::sasxport.get} by Frank E. Harrell, Jr.} \section{Note}{ This code provides a subset of the functionality of the Modified: trunk/SASxport/man/toSAS.Rd =================================================================== --- trunk/SASxport/man/toSAS.Rd 2010-11-12 02:41:05 UTC (rev 1455) +++ trunk/SASxport/man/toSAS.Rd 2010-11-12 02:45:39 UTC (rev 1456) @@ -44,7 +44,7 @@ A vector of type "character" or of type "numeric", with an attribute named "label" containing the SAS format specification. } -\author{ Gregory R. Warnes \email{gr...@ra...} } +\author{ Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link{write.xport}}, \code{\link{read.xport}}, Modified: trunk/SASxport/man/write.xport.Rd =================================================================== --- trunk/SASxport/man/write.xport.Rd 2010-11-12 02:41:05 UTC (rev 1455) +++ trunk/SASxport/man/write.xport.Rd 2010-11-12 02:45:39 UTC (rev 1456) @@ -68,7 +68,7 @@ Data Set in SAS Transport (XPORT) Format'' available at \url{http://ftp.sas.com/techsup/download/technote/ts140.html}. } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} \note{ This package was created by Random Technologies LLC \url{http://random-technologies-llc.com} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-11-12 02:41:12
|
Revision: 1455 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1455&view=rev Author: warnes Date: 2010-11-12 02:41:05 +0000 (Fri, 12 Nov 2010) Log Message: ----------- Fix bug: 'as.is=TRUE' argument to read.xport was being ignored. Modified Paths: -------------- trunk/SASxport/R/read.xport.R trunk/SASxport/R/xport.R Modified: trunk/SASxport/R/read.xport.R =================================================================== --- trunk/SASxport/R/read.xport.R 2010-11-12 02:36:34 UTC (rev 1454) +++ trunk/SASxport/R/read.xport.R 2010-11-12 02:41:05 UTC (rev 1455) @@ -54,8 +54,7 @@ whichds <- setdiff(names(dsinfo), c(toupper(drop),'_CONTENTS_','_contents_')) scat("Reading the data file...") - ds <- read.xport.inner(file) - + ds <- read.xport.inner(file, stringsAsFactors=FALSE) if(any(duplicated(names(dsinfo)))) # only true if file contains has more than one data set { warning("Duplicate data set names in file. Data set names have been made unique.") @@ -106,8 +105,8 @@ names(res) <- gsub('_','.',dsn) - possiblyConvertChar <- (is.logical(as.is) && !as.is) || - (is.numeric(as.is) && as.is > 0) + possiblyConvertChar <- (is.logical(as.is) && !as.is) || + (is.numeric(as.is) && as.is > 0) j <- 0 for(k in which.regular) { j <- j + 1 Modified: trunk/SASxport/R/xport.R =================================================================== --- trunk/SASxport/R/xport.R 2010-11-12 02:36:34 UTC (rev 1454) +++ trunk/SASxport/R/xport.R 2010-11-12 02:41:05 UTC (rev 1455) @@ -24,9 +24,11 @@ lookup.xport.inner <- function(file) .Call(xport_info, file) -read.xport.inner <- function(file) { +read.xport.inner <- function(file, stringsAsFactors=FALSE) { data.info <- lookup.xport.inner(file) ans <- .Call(xport_read, file, data.info) - if (length(ans) == 1) as.data.frame(ans[[1]]) - else lapply(ans, as.data.frame) + if (length(ans) == 1) + as.data.frame(ans[[1]], stringsAsFactors=stringsAsFactors) + else + lapply(ans, as.data.frame, stringsAsFactors=stringsAsFactors) } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ar...@us...> - 2010-11-01 00:30:26
|
Revision: 1453 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1453&view=rev Author: arnima Date: 2010-11-01 00:30:20 +0000 (Mon, 01 Nov 2010) Log Message: ----------- Minor improvement in Args.Rd help page Modified Paths: -------------- trunk/gdata/man/Args.Rd Modified: trunk/gdata/man/Args.Rd =================================================================== --- trunk/gdata/man/Args.Rd 2010-10-19 22:04:49 UTC (rev 1452) +++ trunk/gdata/man/Args.Rd 2010-11-01 00:30:20 UTC (rev 1453) @@ -17,9 +17,8 @@ containing the default value of each argument. } \note{ - In recent versions of \R, primitive functions like \code{sum} and - \code{all} have no formal arguments. See the \code{\link{formals}} - help page. + Primitive functions like \code{sum} and \code{all} have no formal + arguments. See the \code{\link{formals}} help page. } \author{Arni Magnusson} \seealso{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-10-19 22:04:55
|
Revision: 1452 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1452&view=rev Author: warnes Date: 2010-10-19 22:04:49 +0000 (Tue, 19 Oct 2010) Log Message: ----------- Avoid use of file.access() which is unreliable on Windows network shares. Modified Paths: -------------- trunk/gdata/R/onAttach.R trunk/gdata/R/xls2sep.R Modified: trunk/gdata/R/onAttach.R =================================================================== --- trunk/gdata/R/onAttach.R 2010-08-14 19:28:55 UTC (rev 1451) +++ trunk/gdata/R/onAttach.R 2010-10-19 22:04:49 UTC (rev 1452) @@ -1,8 +1,13 @@ .onAttach <- function(libname, pkgname) { show <- function(...) - writeLines(strwrap( x=list(...), prefix="gdata: " )) - + packageStartupMessage( + paste( + strwrap(x = list(...), + prefix = "gdata: "), + collapse="\n",sep="\n" + ) + ) try( { Modified: trunk/gdata/R/xls2sep.R =================================================================== --- trunk/gdata/R/xls2sep.R 2010-08-14 19:28:55 UTC (rev 1451) +++ trunk/gdata/R/xls2sep.R 2010-10-19 22:04:49 UTC (rev 1452) @@ -45,9 +45,6 @@ xls <- tf } - if(file.access(xls, 4)!=0) - stop("Unable to read xls file '", xls, "'." ) - if(method=="csv") { script <- file.path(perl.dir,'xls2csv.pl') @@ -95,21 +92,29 @@ ## ## do the translation if(verbose) cat("Executing '", cmd, "'... \n\n") - ## - results <- system(cmd, intern=!verbose) + + results <- try(system(cmd, intern=!verbose)) + + if(inherits(results, "try-error")) + stop( "Unable to read xls file '", xls, "':", results ) + if(verbose) cat(results,"\n\n") - ## if (verbose) cat("Done.\n\n") + ## + ## check that the target file was created ## + if(!file.exists(targetFile)) + stop( "Intermediate file '", targetFile, "' missing!" ) - if(file.access(targetFile, 4)!=0) - stop("Unable to read translated ", method, " file '", targetFile, "'." ) - - if (verbose) cat("Done.\n") + ## Creae a file object to hand to the next stage.. + retval <- try(file(targetFile)) + if(inherits(retval, "try-error")) + stop("Unable to open intermediate file '", targetFile, "':", + retval) - ## prepare for cleanup now, in case of error reading file - file(targetFile) + return(retval) + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-08-14 19:29:01
|
Revision: 1451 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1451&view=rev Author: warnes Date: 2010-08-14 19:28:55 +0000 (Sat, 14 Aug 2010) Log Message: ----------- Modify mixedorder()/mixedsort() to better handle strings containing multiple periods, like version numbers (e.g 1.1.2, 1.2.1. 1.1.1.1). Modified Paths: -------------- trunk/gtools/R/mixedsort.R Modified: trunk/gtools/R/mixedsort.R =================================================================== --- trunk/gtools/R/mixedsort.R 2010-07-23 01:19:16 UTC (rev 1450) +++ trunk/gtools/R/mixedsort.R 2010-08-14 19:28:55 UTC (rev 1451) @@ -45,7 +45,7 @@ #### # find and mark numbers in the form of +1.23e+45.67 - delimited <- gsub("([+-]{0,1}[0-9\\.]+([eE][\\+\\-]{0,1}[0-9\\.]+){0,1})", + delimited <- gsub("([+-]{0,1}[0-9]+([eE][\\+\\-]{0,1}[0-9]+){0,1})", paste(delim,"\\1",delim,sep=""), x) # separate out numbers This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-07-23 01:19:23
|
Revision: 1450 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1450&view=rev Author: warnes Date: 2010-07-23 01:19:16 +0000 (Fri, 23 Jul 2010) Log Message: ----------- Add ChangeLog link and NEWS file and link Added Paths: ----------- trunk/SII/ChangeLog trunk/SII/NEWS trunk/SII/inst/NEWS Added: trunk/SII/ChangeLog =================================================================== --- trunk/SII/ChangeLog (rev 0) +++ trunk/SII/ChangeLog 2010-07-23 01:19:16 UTC (rev 1450) @@ -0,0 +1 @@ +link inst/ChangeLog \ No newline at end of file Property changes on: trunk/SII/ChangeLog ___________________________________________________________________ Added: svn:special + * Added: trunk/SII/NEWS =================================================================== --- trunk/SII/NEWS (rev 0) +++ trunk/SII/NEWS 2010-07-23 01:19:16 UTC (rev 1450) @@ -0,0 +1 @@ +link inst/NEWS \ No newline at end of file Property changes on: trunk/SII/NEWS ___________________________________________________________________ Added: svn:special + * Added: trunk/SII/inst/NEWS =================================================================== --- trunk/SII/inst/NEWS (rev 0) +++ trunk/SII/inst/NEWS 2010-07-23 01:19:16 UTC (rev 1450) @@ -0,0 +1,7 @@ +VERSION 1.0.0 (2010-07-22) +-------------------------- + +Initial public release. + +No known bugs. + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ggr...@us...> - 2010-07-08 12:36:54
|
Revision: 1448 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1448&view=rev Author: ggrothendieck2 Date: 2010-07-08 12:36:48 +0000 (Thu, 08 Jul 2010) Log Message: ----------- findPerl call added to xls2sep Modified Paths: -------------- trunk/gdata/R/xls2sep.R Modified: trunk/gdata/R/xls2sep.R =================================================================== --- trunk/gdata/R/xls2sep.R 2010-07-07 22:48:16 UTC (rev 1447) +++ trunk/gdata/R/xls2sep.R 2010-07-08 12:36:48 UTC (rev 1448) @@ -13,11 +13,16 @@ perl=perl) xls2sep <- function(xls, sheet=1, verbose=FALSE, ..., - method=c("csv","tsv","tab"), perl="perl") + method=c("csv","tsv","tab"), perl = perl) { method <- match.arg(method) + perl <- if (missing(perl)) + findPerl(verbose = verbose) + else + findPerl(perl, verbose = verbose) + ## ## directories package.dir <- .path.package('gdata') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ggr...@us...> - 2010-07-07 22:48:22
|
Revision: 1447 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1447&view=rev Author: ggrothendieck2 Date: 2010-07-07 22:48:16 +0000 (Wed, 07 Jul 2010) Log Message: ----------- small improvements to read.xls.Rd Modified Paths: -------------- trunk/gdata/man/read.xls.Rd Modified: trunk/gdata/man/read.xls.Rd =================================================================== --- trunk/gdata/man/read.xls.Rd 2010-06-11 03:29:12 UTC (rev 1446) +++ trunk/gdata/man/read.xls.Rd 2010-07-07 22:48:16 UTC (rev 1447) @@ -47,6 +47,11 @@ \code{read.table} since the first character of all lines (including comment lines) will be "\"" after conversion. + If you have quotes in your data which confuse the process you may wish to use + \code{read.xls(..., quote = '')}. This will cause the quotes to be regarded + as data and you will have to then handle the quotes yourself after reading + the file in. + Caution: If you call \code{"xls2csv"} directly, is your responsibility to close and delete the file after using it. } @@ -85,6 +90,11 @@ # Example specifying exact Perl path for Unix systems iris <- read.xls(xlsfile, perl="/usr/bin/perl") + # finding perl + # (read.xls automatically calls findPerl so this is rarely needed) + perl <- gdata:::findPerl("perl") + iris <- read.xls(xlsfile, perl=perl) + # read xls file from net nba.url <- "http://mgtclass.mgt.unm.edu/Bose/Excel/Tutorial.05/Cases/NBA.xls" nba <- read.xls(nba.url) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-06-11 03:29:18
|
Revision: 1446 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1446&view=rev Author: warnes Date: 2010-06-11 03:29:12 +0000 (Fri, 11 Jun 2010) Log Message: ----------- Fix errors detected by R CMD check Modified Paths: -------------- trunk/gplots/man/venn.Rd Modified: trunk/gplots/man/venn.Rd =================================================================== --- trunk/gplots/man/venn.Rd 2010-06-11 03:27:44 UTC (rev 1445) +++ trunk/gplots/man/venn.Rd 2010-06-11 03:29:12 UTC (rev 1446) @@ -25,7 +25,7 @@ should be omitted.} \item{show.plot}{Logical flag indicating whether the plot should be displayed. If false, simply returns the group count matrix.} - \item{y}{Ignored} + \item{y,...}{Ignored} } \details{ \code{data} should be either a named list of vectors containing This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-06-11 03:27:50
|
Revision: 1445 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1445&view=rev Author: warnes Date: 2010-06-11 03:27:44 +0000 (Fri, 11 Jun 2010) Log Message: ----------- Fix errors detected by R CMD check Modified Paths: -------------- trunk/gplots/man/venn.Rd Modified: trunk/gplots/man/venn.Rd =================================================================== --- trunk/gplots/man/venn.Rd 2010-06-11 03:17:15 UTC (rev 1444) +++ trunk/gplots/man/venn.Rd 2010-06-11 03:27:44 UTC (rev 1445) @@ -1,5 +1,6 @@ \name{venn} \alias{venn} +\alias{plot.venn} \title{Plot a Venn diagram} \description{ Plot a Venn diagrams for up to 5 sets @@ -11,7 +12,7 @@ simplify=FALSE) } \arguments{ - \item{data}{Either a list list containing vectors of names or indices + \item{data,x}{Either a list list containing vectors of names or indices of group members, or a data frame containing boolean indicators of group membership (see below)} \item{universe}{Subset of valid name/index elements. Values ignore values @@ -24,6 +25,7 @@ should be omitted.} \item{show.plot}{Logical flag indicating whether the plot should be displayed. If false, simply returns the group count matrix.} + \item{y}{Ignored} } \details{ \code{data} should be either a named list of vectors containing @@ -69,10 +71,10 @@ ## Example using a list of item indexes belonging to the ## specified group. ## -GroupA.i <- which(geneNames %in% GroupA) -GroupB.i <- which(geneNames %in% GroupB) -GroupC.i <- which(geneNames %in% GroupC) -GroupD.i <- which(geneNames %in% GroupD) +GroupA.i <- which(geneNames \%in\% GroupA) +GroupB.i <- which(geneNames \%in\% GroupB) +GroupC.i <- which(geneNames \%in\% GroupC) +GroupD.i <- which(geneNames \%in\% GroupD) input.i <-list(A=GroupA.i,B=GroupB.i,C=GroupC.i,D=GroupD.i) input.i @@ -81,16 +83,16 @@ ## ## Example using a data frame of indicator ('f'lag) columns ## -GroupA.f <- geneNames %in% GroupA -GroupB.f <- geneNames %in% GroupB -GroupC.f <- geneNames %in% GroupC -GroupD.f <- geneNames %in% GroupD +GroupA.f <- geneNames \%in\% GroupA +GroupB.f <- geneNames \%in\% GroupB +GroupC.f <- geneNames \%in\% GroupC +GroupD.f <- geneNames \%in\% GroupD input.df <- data.frame(A=GroupA.f,B=GroupB.f,C=GroupC.f,D=GroupD.f) head(input.df) venn(input.df) ## smaller set to create empty groupings -small <- input[1:20,] +small <- input.df[1:20,] venn(small, simplify=FALSE) # with empty groupings venn(small, simplify=TRUE) # without empty groupings @@ -114,10 +116,10 @@ ## universe <- unique(c(GroupA,GroupB,GroupC,GroupD)) -GroupA.l <-universe %in% GroupA -GroupB.l <-universe %in% GroupB -GroupC.l <-universe %in% GroupC -GroupD.l <-universe %in% GroupD +GroupA.l <-universe \%in\% GroupA +GroupB.l <-universe \%in\% GroupB +GroupC.l <-universe \%in\% GroupC +GroupD.l <-universe \%in\% GroupD ## Genes that are in GroupA and in GroupB but not in GroupD (unification ## of sets III0 and II00 in the venn diagram: @@ -126,7 +128,7 @@ ## ## Alternatively: construct a function to test for the pattern you want. ## -test <- function(x) (x %in% GroupA) & (x %in% GroupB) & !(x %in% GroupC) +test <- function(x) (x \%in\% GroupA) & (x \%in\% GroupB) & !(x \%in\% GroupC) universe[ test(universe) ] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-06-11 03:17:21
|
Revision: 1444 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1444&view=rev Author: warnes Date: 2010-06-11 03:17:15 +0000 (Fri, 11 Jun 2010) Log Message: ----------- Use 'TRUE' instead of 'T' for true in venn man page Modified Paths: -------------- trunk/gplots/man/venn.Rd Modified: trunk/gplots/man/venn.Rd =================================================================== --- trunk/gplots/man/venn.Rd 2010-06-11 03:15:19 UTC (rev 1443) +++ trunk/gplots/man/venn.Rd 2010-06-11 03:17:15 UTC (rev 1444) @@ -51,7 +51,7 @@ ## ## construct some fake gene names.. -oneName <- function() paste(sample(LETTERS,5,replace=T),collapse="") +oneName <- function() paste(sample(LETTERS,5,replace=TRUE),collapse="") geneNames <- replicate(1000, oneName()) ## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-06-11 03:15:25
|
Revision: 1443 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1443&view=rev Author: warnes Date: 2010-06-11 03:15:19 +0000 (Fri, 11 Jun 2010) Log Message: ----------- Update for gplots 2.8.0 Modified Paths: -------------- trunk/gplots/DESCRIPTION trunk/gplots/NAMESPACE trunk/gplots/inst/NEWS Modified: trunk/gplots/DESCRIPTION =================================================================== --- trunk/gplots/DESCRIPTION 2010-06-11 03:14:38 UTC (rev 1442) +++ trunk/gplots/DESCRIPTION 2010-06-11 03:15:19 UTC (rev 1443) @@ -4,11 +4,12 @@ Depends: gtools, gdata, stats, caTools, grid Recommends: datasets, grid Suggests: gtools -Version: 2.7.5 +Version: 2.8.0 +Date: 2010-06-10 Author: Gregory R. Warnes. Includes R source code and/or documentation contributed by (in alphabetical order): Ben Bolker, Lodewijk Bonebakker, Robert Gentleman, Wolfgang Huber Andy Liaw, Thomas Lumley, Martin Maechler, Arni Magnusson, Steffen Moeller, Marc Schwartz, Bill Venables -Maintainer: Gregory R. Warnes <gr...@ra...> +Maintainer: Gregory R. Warnes <gr...@wa...> License: GPL-2 Modified: trunk/gplots/NAMESPACE =================================================================== --- trunk/gplots/NAMESPACE 2010-06-11 03:14:38 UTC (rev 1442) +++ trunk/gplots/NAMESPACE 2010-06-11 03:15:19 UTC (rev 1443) @@ -14,6 +14,7 @@ overplot, panel.overplot, plot.lm2, + plot.venn, plotCI, plotmeans, qqnorm.aov, Modified: trunk/gplots/inst/NEWS =================================================================== --- trunk/gplots/inst/NEWS 2010-06-11 03:14:38 UTC (rev 1442) +++ trunk/gplots/inst/NEWS 2010-06-11 03:15:19 UTC (rev 1443) @@ -1,3 +1,15 @@ +Release 2.8.0 - 2010-06-10 +-------------------------- + +Improvements: + +- venn() now returns an object of class venn() and a plot method for + this class is provided. + +- Manual page for venn has been improved, based on contributions by + Steffen Moeller + + Release 2.7.5 - ?? -------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-06-11 03:14:44
|
Revision: 1442 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1442&view=rev Author: warnes Date: 2010-06-11 03:14:38 +0000 (Fri, 11 Jun 2010) Log Message: ----------- Moved baseOf() into a separate file Added Paths: ----------- trunk/gplots/R/baseOf.R Added: trunk/gplots/R/baseOf.R =================================================================== --- trunk/gplots/R/baseOf.R (rev 0) +++ trunk/gplots/R/baseOf.R 2010-06-11 03:14:38 UTC (rev 1442) @@ -0,0 +1,25 @@ + +# transform base +# v = value of base 10 to be transformed +# b = new base +# l = minimal length of returned array (default is 1) +# return value: array of factors, highest exponent first +baseOf<-function(v,b,l=1) { + remainder<-v + i<-l + ret<-NULL + while(remainder>0 || i>0) { + #print(paste("i=",i," remainder=",remainder)) + m<-remainder%%b + if (is.null(ret)) { + ret<-m + } + else { + ret<-c(m,ret) + } + remainder <- remainder %/% b + i<-i-1 + } + return(ret) +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-06-11 03:12:00
|
Revision: 1441 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1441&view=rev Author: warnes Date: 2010-06-11 03:11:54 +0000 (Fri, 11 Jun 2010) Log Message: ----------- Update Greg's email address Modified Paths: -------------- trunk/gplots/man/balloonplot.Rd trunk/gplots/man/bandplot.Rd trunk/gplots/man/boxplot.n.Rd trunk/gplots/man/colorpanel.Rd trunk/gplots/man/hist2d.Rd trunk/gplots/man/ooplot.Rd trunk/gplots/man/overplot.Rd trunk/gplots/man/plot.lm2.Rd trunk/gplots/man/plotCI.Rd trunk/gplots/man/plotmeans.Rd trunk/gplots/man/residplot.Rd trunk/gplots/man/sinkplot.Rd trunk/gplots/man/smartlegend.Rd trunk/gplots/man/space.Rd trunk/gplots/man/textplot.Rd trunk/gplots/man/wapply.Rd Modified: trunk/gplots/man/balloonplot.Rd =================================================================== --- trunk/gplots/man/balloonplot.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/balloonplot.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -118,7 +118,7 @@ \references{Function inspired by question posed on R-help by Ramon Alonso-Allende \email{al...@cn...}.} -\author{ Gregory R. Warnes \email{gr...@ra...} } +\author{ Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link{plot.table}} } Modified: trunk/gplots/man/bandplot.Rd =================================================================== --- trunk/gplots/man/bandplot.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/bandplot.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -60,7 +60,7 @@ \value{ Invisibly returns a list containing the x,y points plotted for each line. } -\author{ Gregory R. Warnes \email{gr...@ra...} +\author{ Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link{wapply}}, \code{\link{lowess}}} \examples{ Modified: trunk/gplots/man/boxplot.n.Rd =================================================================== --- trunk/gplots/man/boxplot.n.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/boxplot.n.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -38,7 +38,7 @@ \item{shrink}{ value to shrink character size (cex) when annotating.} \item{textcolor}{ text color. } } -\author{ Gregory R. Warnes \email{gr...@ra...}} +\author{ Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link{boxplot}}, \code{\link{text}}} \examples{ Modified: trunk/gplots/man/colorpanel.Rd =================================================================== --- trunk/gplots/man/colorpanel.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/colorpanel.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -42,7 +42,7 @@ \value{ Vector of HTML-style RGB colors. } -\author{ Gregory R. Warnes \email{gr...@ra...} } +\author{ Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link{colors} } } \examples{ Modified: trunk/gplots/man/hist2d.Rd =================================================================== --- trunk/gplots/man/hist2d.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/hist2d.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -63,7 +63,7 @@ \item{y}{lower y limit of each bin} } %\references{ ~put references to the literature/web site here ~ } -\author{ Gregory R. Warnes \email{gr...@ra...}} +\author{ Gregory R. Warnes \email{gr...@wa...}} %\note{ ~~further notes~~ } \seealso{ \code{\link{image}}, \code{\link{persp}}, \code{\link{hist}} } Modified: trunk/gplots/man/ooplot.Rd =================================================================== --- trunk/gplots/man/ooplot.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/ooplot.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -157,7 +157,7 @@ midpoints of each \emph{group} of bars, see example. } \author{Lodewijk Bonebakker \email{bon...@co...} with modifications - by Gregory R. Warnes \email{gr...@ra...}. + by Gregory R. Warnes \email{gr...@wa...}. Based on barplot2(). } \seealso{ \code{\link{plot}}, \code{\link{boxplot}} } Modified: trunk/gplots/man/overplot.Rd =================================================================== --- trunk/gplots/man/overplot.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/overplot.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -55,7 +55,7 @@ \value{ A copy of the data split by the conditioning variable. } -\author{ Gregory R. Warnes \email{gr...@ra...} } +\author{ Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link{interaction.plot}}, \code{\link{coplot}} for alternative visualizations of 3-way data.} Modified: trunk/gplots/man/plot.lm2.Rd =================================================================== --- trunk/gplots/man/plot.lm2.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/plot.lm2.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -53,7 +53,7 @@ \item{width}{Fraction of the data to use for plot smooths} \item{max.n}{Maximum number of points to display in plots} } -\author{Gregory R. Warnes \email{gr...@ra...} and Nitin +\author{Gregory R. Warnes \email{gr...@wa...} and Nitin Jain \email{nit...@pf...}} \examples{ ctl <- rnorm(100, 4) Modified: trunk/gplots/man/plotCI.Rd =================================================================== --- trunk/gplots/man/plotCI.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/plotCI.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -115,7 +115,7 @@ Sep. 20, 1997. Enhanced version posted to r-help by Ben Bolker \email{be...@zo...} on Apr. 16, 2001. This version was modified and extended by Gregory R. Warnes - \email{gr...@ra...}. Additional changes + \email{gr...@wa...}. Additional changes suggested by Martin Maechler \email{mae...@st...} integrated on July 29, 2004. } Modified: trunk/gplots/man/plotmeans.Rd =================================================================== --- trunk/gplots/man/plotmeans.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/plotmeans.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -137,7 +137,7 @@ } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} \seealso{\code{\link{plotCI}}, \code{\link{boxplot}}} Modified: trunk/gplots/man/residplot.Rd =================================================================== --- trunk/gplots/man/residplot.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/residplot.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -20,5 +20,5 @@ These functions are undocumented. Some are internal and not intended for direct use. Others simply haven't been documented yet. } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} \keyword{misc} Modified: trunk/gplots/man/sinkplot.Rd =================================================================== --- trunk/gplots/man/sinkplot.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/sinkplot.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -32,7 +32,7 @@ \references{Functionality requested by Kevin Wright \email{kw...@es...} in the R-devel newlist posting \url{https://www.stat.math.ethz.ch/pipermail/r-devel/2004-January/028483.html}} -\author{ Gregory R. Warnes \email{gr...@ra...} } +\author{ Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link[utils]{capture.output}}, \code{\link{textplot}} } \examples{ \dontrun{ Modified: trunk/gplots/man/smartlegend.Rd =================================================================== --- trunk/gplots/man/smartlegend.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/smartlegend.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -23,7 +23,7 @@ \value{ Same as \code{legend} } -\author{Gregory R. Warnes \email{gr...@ra...} } +\author{Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link{legend}} } \examples{ Modified: trunk/gplots/man/space.Rd =================================================================== --- trunk/gplots/man/space.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/space.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -63,7 +63,7 @@ \item{x}{(modified) x location for each input point} \item{y}{y location of each input point} } -\author{ Gregory R. Warnes \email{gr...@ra...} } +\author{ Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link{jitter}}, \code{\link{sunflowerplot}} } \examples{ Modified: trunk/gplots/man/textplot.Rd =================================================================== --- trunk/gplots/man/textplot.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/textplot.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -79,7 +79,7 @@ \value{ The character scaling factor (\code{cex}) used. } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link{plot}}, \code{\link{text}}, \code{\link[utils]{capture.output}} } Modified: trunk/gplots/man/wapply.Rd =================================================================== --- trunk/gplots/man/wapply.Rd 2010-06-11 03:11:16 UTC (rev 1440) +++ trunk/gplots/man/wapply.Rd 2010-06-11 03:11:54 UTC (rev 1441) @@ -103,7 +103,7 @@ \item{x }{x location'} \item{y }{Result of applying \code{fun} to the window about each x location} } -\author{ Gregory R. Warnes \email{gr...@ra...} +\author{ Gregory R. Warnes \email{gr...@wa...} } \examples{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-06-11 03:11:22
|
Revision: 1440 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1440&view=rev Author: warnes Date: 2010-06-11 03:11:16 +0000 (Fri, 11 Jun 2010) Log Message: ----------- - venn() now returns an object of class venn() and a plot method for this class is provided. - Manual page for venn has been improved, based on contributions by Steffen Moeller Modified Paths: -------------- trunk/gplots/R/venn.R trunk/gplots/man/venn.Rd Added Paths: ----------- trunk/gplots/R/plot.venn.R Copied: trunk/gplots/R/plot.venn.R (from rev 1431, trunk/gplots/R/venn.R) =================================================================== --- trunk/gplots/R/plot.venn.R (rev 0) +++ trunk/gplots/R/plot.venn.R 2010-06-11 03:11:16 UTC (rev 1440) @@ -0,0 +1,284 @@ + +plot.venn <- function(x, y, ..., + small=0.7, + showSetLogicLabel=FALSE, + simplify=FALSE + ) + { + drawVennDiagram( + data=x, + small=small, + showSetLogicLabel=showSetLogicLabel, + simplify=simplify + ) + } + +## data should be a matrix. +## - The first column of the matrix is the +## count of the number of objects with the specified pattern. +## - The second and subsequent columns contain 0-1 indicators +## giving the pattern of group membership + + +drawVennDiagram <-function(data,small=0.7, + showSetLogicLabel=FALSE,simplify=FALSE) { + numCircles<-NA + data.colnames<-NULL + data.rownames<-NULL + if(is.matrix(data)) { + numCircles<-ncol(data)-1 + data.colnames<-colnames(data)[2:(ncol(data))] + # Order is reverted since later indexing starts with + # the "lowest bit" and that is expected at the left + data.rownames<-rownames(data) + } + else { + cat("Testing only, presuming first argument to specify", + "the number of circles to draw.\n") + numCircles<-data + } + + m<-(0:(-1+2^numCircles)) + + if (! is.matrix(data)) { + ##cat("prepare randomised data\n") + data<-t(sapply(X=m,FUN=function(v){ + l<-baseOf(v,2,numCircles) + #print(l) + return(l) + })) + + #print(data) + + #data.names<-apply(data,1,function(X){ + # return(paste(X),collapse="") + #}) + for(i in m) { + n<-paste(data[i+1,],collapse="") + if (is.null(data.rownames)) { + data.rownames<-n + } + else { + data.rownames<-c(data.rownames,n) + } + } + #print(data.rownames) + data<-cbind(sample(1:100,size=2^numCircles,replace=TRUE),data) + #print(data) + rownames(data)<-data.rownames + data.colnames<-LETTERS[1:numCircles] + colnames(data)<-c("num",data.colnames) + } + + if ((2 <= numCircles && numCircles <= 3) || (4 == numCircles && simplify)) { + ##cat("drawing circles\n") + # draw circles with radius 1.7 equally distributed + # with centers on a circle of radius 1 + + degrees<-2*pi/numCircles*(1:numCircles) + + # scaling factor + s<-1/8 + + x<-sapply(degrees,FUN=sin)*s + 0.5 + y<-sapply(degrees,FUN=cos)*s + 0.5 + + + if(!require(grid)) { + stop("Need access to 'grid' library.") + } + grid.newpage() + grid.circle(x,y,3/12,name="some name") + + ##cat("filling data\n") + + distFromZero<-rep(NA,2^numCircles) + degrees<-rep(NA,2^numCircles) + + degrees[(2^numCircles)]<-0 + distFromZero[(2^numCircles)]<-0 + + for (i in 0:(numCircles-1)) { + distFromZero[2^i+1] <- 4/12 + degrees[2^i+1] <- 2*pi/numCircles*i + d<-degrees[2^i+1] + + #print(data.colnames) + + grid.text( + # starting from the lowest bit, hence reading + # lables from the right + label=data.colnames[numCircles - i], + x=sin(d)*5/12+0.5, + y=cos(d)*5/12+0.5, + rot=0 + ) + + } + + if (4==numCircles) { + for (i in 0:(numCircles-1)) { + # Current set bit plus the bit left of it and the bit right of it + distFromZero[2^i + +2^((i+numCircles-1)%%numCircles) + +2^((i+1)%%numCircles)+1] <- 2/12 + degrees[2^i + +2^((i+numCircles-1)%%numCircles) + +2^((i+1)%%numCircles)+1] <- degrees[2^i+1] + } + } + + #degrees[2^i+1] + degrees[2^((i+1)%%numCircles)+1])/2 + + if (3 <=numCircles) { + for (i in 0:(numCircles-1)) { + distFromZero[(2^i+2^((i+1)%%numCircles))+1]<- 3/12 + if (i == (numCircles-1)) { + degrees[(2^i+2^((i+1)%%numCircles))+1] <- ( + degrees[2^i+1] + 2*pi+ degrees[1+1])/2 + } + else { + degrees[(2^i+2^((i+1)%%numCircles))+1] <- ( + degrees[2^i+1] + degrees[2^((i+1)%%numCircles)+1])/2 + } + + } + } + + for(i in 1:2^numCircles) { + n<-paste(baseOf((i-1),2,numCircles),collapse="") + v<-data[n,1] + d<-degrees[i] + if (1 == length(d) && is.na(d)) { + if (v>0) warning("Not shown: ",n,"is",v,"\n") + } + else { + l<-distFromZero[i] + x<-sin(d)*l+0.5 + y<-cos(d)*l+0.5 + #cat("i=",i," x=",x," y=",y," label=",n,"\n") + l<-v + if (showSetLogicLabel) l<-paste(n,"\n",v,sep="") + grid.text(label=l,x=x,y=y,rot=0) + } + } + } + else if (4 <= numCircles && numCircles <= 5 && !simplify) { + + grid.newpage() + # Function to turn and move ellipses + relocate_elp <- function(e, alpha, x, y){ + phi=(alpha/180)*pi; + xr=e[,1]*cos(phi)+e[,2]*sin(phi) + yr=-e[,1]*sin(phi)+e[,2]*cos(phi) + xr=x+xr; + yr=y+yr; + return(cbind(xr, yr)) + } + + lab<-function (identifier, data, showLabel=showSetLogicLabel) { + r<-data[identifier,1] + if (showLabel) { + return(paste(identifier,r,sep="\n")) + } + else { + return(r) + } + } + + plot(c(0, 400), c(0, 400), type="n", axes=F, ylab="", xlab="") + if (4 == numCircles) { + elps=cbind(162*cos(seq(0,2*pi,len=1000)), 108*sin(seq(0,2*pi,len=1000))); + + plot(c(0, 400), c(0, 400), type="n", axes=F, ylab="", xlab=""); + polygon(relocate_elp(elps, 45,130, 170)); + polygon(relocate_elp(elps, 45,200, 200)); + polygon(relocate_elp(elps, 135,200, 200)); + polygon(relocate_elp(elps, 135,270, 170)); + + text( 35, 315, data.colnames[1],cex=1.5) + text(138, 347, data.colnames[2],cex=1.5) + text(262, 347, data.colnames[3],cex=1.5) + text(365, 315, data.colnames[4],cex=1.5) + + elps <- cbind(130*cos(seq(0,2*pi,len=1000)), + 80*sin(seq(0,2*pi,len=1000))) + + text( 35, 250, lab("1000",data)); + text(140, 315, lab("0100",data)); + text(260, 315, lab("0010",data)); + text(365, 250, lab("0001",data)); + + text( 90, 280, lab("1100",data), cex=small) + text( 95, 110, lab("1010",data) ) + text(200, 50, lab("1001",data), cex=small) + text(200, 290, lab("0110",data)) + text(300, 110, lab("0101",data)) + text(310, 280, lab("0011",data), cex=small) + + text(130, 230, lab("1110",data)) + text(245, 75, lab("1101",data),cex=small) + text(155, 75, lab("1011",data),cex=small) + text(270, 230, lab("0111",data)) + + text(200,150,lab("1111",data)) + } + else if (5 == numCircles) { + + elps <- cbind(150*cos(seq(0,2*pi,len=1000)), + 60*sin(seq(0,2*pi,len=1000))) + + polygon(relocate_elp(elps, 90,200, 250)) + polygon(relocate_elp(elps, 162,250, 220)) + polygon(relocate_elp(elps, 234,250, 150)) + polygon(relocate_elp(elps, 306,180, 125)) + polygon(relocate_elp(elps, 378,145, 200)) + + text( 50, 280, data.colnames[1],cex=1.5) + text(150, 400, data.colnames[2],cex=1.5) + text(350, 300, data.colnames[3],cex=1.5) + text(350, 20, data.colnames[4],cex=1.5) + text( 50, 10, data.colnames[5],cex=1.5) + + text( 61, 228, lab("10000",data)); + text(194, 329, lab("01000",data)); + text(321, 245, lab("00100",data)); + text(290, 81, lab("00010",data)); + text(132, 69, lab("00001",data)); + + text(146, 250, lab("11000",data), cex=small) + text(123, 188, lab("10100",data), cex=small) + text(275, 152, lab("10010",data), cex=small) + text(137, 146, lab("10001",data), cex=small) + text(243, 268, lab("01100",data), cex=small) + text(175, 267, lab("01010",data), cex=small) + text(187, 117, lab("01001",data), cex=small) + text(286, 188, lab("00110",data), cex=small) + text(267, 235, lab("00101",data), cex=small) + text(228, 105, lab("00011",data), cex=small) + + text(148, 210, lab("11100",data),cex=small) + text(159, 253, lab("11010",data),cex=small) + text(171, 141, lab("11001",data),cex=small) + text(281, 175, lab("10110",data),cex=small) + text(143, 163, lab("10101",data),cex=small) + text(252, 145, lab("10011",data),cex=small) + text(205, 255, lab("01110",data),cex=small) + text(254, 243, lab("01101",data),cex=small) + text(211, 118, lab("01011",data),cex=small) + text(267, 211, lab("00111",data),cex=small) + + text(170, 231,lab("11110",data),cex=small) + text(158, 169,lab("11101",data),cex=small) + text(212, 139,lab("11011",data),cex=small) + text(263, 180,lab("10111",data),cex=small) + text(239, 232,lab("01111",data),cex=small) + + text(204,190,lab("11111",data)) + } + } + else { + stop(paste("The printing of ",numCircles," circles is not yet supported.")) + } + +} Modified: trunk/gplots/R/venn.R =================================================================== --- trunk/gplots/R/venn.R 2010-05-03 16:26:14 UTC (rev 1439) +++ trunk/gplots/R/venn.R 2010-06-11 03:11:16 UTC (rev 1440) @@ -9,30 +9,6 @@ # The sum of values placed is the number of entries of # each set. -# transform base -# v = value of base 10 to be transformed -# b = new base -# l = minimal length of returned array (default is 1) -# return value: array of factors, highest exponent first -baseOf<-function(v,b,l=1) { - remainder<-v - i<-l - ret<-NULL - while(remainder>0 || i>0) { - #print(paste("i=",i," remainder=",remainder)) - m<-remainder%%b - if (is.null(ret)) { - ret<-m - } - else { - ret<-c(m,ret) - } - remainder <- remainder %/% b - i<-i-1 - } - return(ret) -} - # Function to determine values of a venn diagram # It works for an arbitrary large set of input sets. # @@ -82,7 +58,7 @@ else { sel<-NULL } - } + } } # something should be in sel now, otherwise @@ -139,284 +115,13 @@ else{ colnames(result.table)<-c("num",names(l)) } + class(result.table) <- "venn" return(result.table) } #print(getVennCounts(list(A,B,C,D))) #print(getVennCounts(list(a=A,b=B,c=C,d=D))) - -## data should be a matrix. -## - The first column of the matrix is the -## count of the number of objects with the specified pattern. -## - The second and subsequent columns contain 0-1 indicators -## giving the pattern of group membership - - -drawVennDiagram <-function(data,small=0.7, - showSetLogicLabel=FALSE,simplify=FALSE) { - numCircles<-NA - data.colnames<-NULL - data.rownames<-NULL - if(is.matrix(data)) { - numCircles<-ncol(data)-1 - data.colnames<-colnames(data)[2:(ncol(data))] - # Order is reverted since later indexing starts with - # the "lowest bit" and that is expected at the left - data.rownames<-rownames(data) - } - else { - cat("Testing only, presuming first argument to specify", - "the number of circles to draw.\n") - numCircles<-data - } - - m<-(0:(-1+2^numCircles)) - - if (! is.matrix(data)) { - ##cat("prepare randomised data\n") - data<-t(sapply(X=m,FUN=function(v){ - l<-baseOf(v,2,numCircles) - #print(l) - return(l) - })) - - #print(data) - - #data.names<-apply(data,1,function(X){ - # return(paste(X),collapse="") - #}) - for(i in m) { - n<-paste(data[i+1,],collapse="") - if (is.null(data.rownames)) { - data.rownames<-n - } - else { - data.rownames<-c(data.rownames,n) - } - } - #print(data.rownames) - data<-cbind(sample(1:100,size=2^numCircles,replace=TRUE),data) - #print(data) - rownames(data)<-data.rownames - data.colnames<-LETTERS[1:numCircles] - colnames(data)<-c("num",data.colnames) - } - - if ((2 <= numCircles && numCircles <= 3) || (4 == numCircles && simplify)) { - ##cat("drawing circles\n") - # draw circles with radius 1.7 equally distributed - # with centers on a circle of radius 1 - - degrees<-2*pi/numCircles*(1:numCircles) - - # scaling factor - s<-1/8 - - x<-sapply(degrees,FUN=sin)*s + 0.5 - y<-sapply(degrees,FUN=cos)*s + 0.5 - - - if(!require(grid)) { - stop("Need access to 'grid' library.") - } - grid.newpage() - grid.circle(x,y,3/12,name="some name") - - ##cat("filling data\n") - - distFromZero<-rep(NA,2^numCircles) - degrees<-rep(NA,2^numCircles) - - degrees[(2^numCircles)]<-0 - distFromZero[(2^numCircles)]<-0 - - for (i in 0:(numCircles-1)) { - distFromZero[2^i+1] <- 4/12 - degrees[2^i+1] <- 2*pi/numCircles*i - d<-degrees[2^i+1] - - #print(data.colnames) - - grid.text( - # starting from the lowest bit, hence reading - # lables from the right - label=data.colnames[numCircles - i], - x=sin(d)*5/12+0.5, - y=cos(d)*5/12+0.5, - rot=0 - ) - - } - - if (4==numCircles) { - for (i in 0:(numCircles-1)) { - # Current set bit plus the bit left of it and the bit right of it - distFromZero[2^i - +2^((i+numCircles-1)%%numCircles) - +2^((i+1)%%numCircles)+1] <- 2/12 - degrees[2^i - +2^((i+numCircles-1)%%numCircles) - +2^((i+1)%%numCircles)+1] <- degrees[2^i+1] - } - } - - #degrees[2^i+1] + degrees[2^((i+1)%%numCircles)+1])/2 - - if (3 <=numCircles) { - for (i in 0:(numCircles-1)) { - distFromZero[(2^i+2^((i+1)%%numCircles))+1]<- 3/12 - if (i == (numCircles-1)) { - degrees[(2^i+2^((i+1)%%numCircles))+1] <- ( - degrees[2^i+1] + 2*pi+ degrees[1+1])/2 - } - else { - degrees[(2^i+2^((i+1)%%numCircles))+1] <- ( - degrees[2^i+1] + degrees[2^((i+1)%%numCircles)+1])/2 - } - - } - } - - for(i in 1:2^numCircles) { - n<-paste(baseOf((i-1),2,numCircles),collapse="") - v<-data[n,1] - d<-degrees[i] - if (1 == length(d) && is.na(d)) { - if (v>0) warning("Not shown: ",n,"is",v,"\n") - } - else { - l<-distFromZero[i] - x<-sin(d)*l+0.5 - y<-cos(d)*l+0.5 - #cat("i=",i," x=",x," y=",y," label=",n,"\n") - l<-v - if (showSetLogicLabel) l<-paste(n,"\n",v,sep="") - grid.text(label=l,x=x,y=y,rot=0) - } - } - } - else if (4 <= numCircles && numCircles <= 5 && !simplify) { - - grid.newpage() - # Function to turn and move ellipses - relocate_elp <- function(e, alpha, x, y){ - phi=(alpha/180)*pi; - xr=e[,1]*cos(phi)+e[,2]*sin(phi) - yr=-e[,1]*sin(phi)+e[,2]*cos(phi) - xr=x+xr; - yr=y+yr; - return(cbind(xr, yr)) - } - - lab<-function (identifier, data, showLabel=showSetLogicLabel) { - r<-data[identifier,1] - if (showLabel) { - return(paste(identifier,r,sep="\n")) - } - else { - return(r) - } - } - - plot(c(0, 400), c(0, 400), type="n", axes=F, ylab="", xlab="") - if (4 == numCircles) { - elps=cbind(162*cos(seq(0,2*pi,len=1000)), 108*sin(seq(0,2*pi,len=1000))); - - plot(c(0, 400), c(0, 400), type="n", axes=F, ylab="", xlab=""); - polygon(relocate_elp(elps, 45,130, 170)); - polygon(relocate_elp(elps, 45,200, 200)); - polygon(relocate_elp(elps, 135,200, 200)); - polygon(relocate_elp(elps, 135,270, 170)); - - text( 35, 315, data.colnames[1],cex=1.5) - text(138, 347, data.colnames[2],cex=1.5) - text(262, 347, data.colnames[3],cex=1.5) - text(365, 315, data.colnames[4],cex=1.5) - - elps <- cbind(130*cos(seq(0,2*pi,len=1000)), - 80*sin(seq(0,2*pi,len=1000))) - - text( 35, 250, lab("1000",data)); - text(140, 315, lab("0100",data)); - text(260, 315, lab("0010",data)); - text(365, 250, lab("0001",data)); - - text( 90, 280, lab("1100",data), cex=small) - text( 95, 110,lab("1010",data) ) - text(200, 50, lab("1001",data), cex=small) - text(200, 290, lab("0110",data)) - text(300, 110, lab("0101",data)) - text(310, 280, lab("0011",data), cex=small) - - text(130, 230, lab("1110",data)) - text(245, 75, lab("1101",data),cex=small) - text(155, 75, lab("1011",data),cex=small) - text(270, 230, lab("0111",data)) - - text(200,150,lab("1111",data)) - } - else if (5 == numCircles) { - - elps <- cbind(150*cos(seq(0,2*pi,len=1000)), - 60*sin(seq(0,2*pi,len=1000))) - - polygon(relocate_elp(elps, 90,200, 250)) - polygon(relocate_elp(elps, 162,250, 220)) - polygon(relocate_elp(elps, 234,250, 150)) - polygon(relocate_elp(elps, 306,180, 125)) - polygon(relocate_elp(elps, 378,145, 200)) - - text( 50, 280, data.colnames[1],cex=1.5) - text(150, 400, data.colnames[2],cex=1.5) - text(350, 300, data.colnames[3],cex=1.5) - text(350, 20, data.colnames[4],cex=1.5) - text( 50, 10, data.colnames[5],cex=1.5) - - text( 61, 228, lab("10000",data)); - text(194, 329, lab("01000",data)); - text(321, 245, lab("00100",data)); - text(290, 81, lab("00010",data)); - text(132, 69, lab("00001",data)); - - text(146, 250, lab("11000",data), cex=small) - text(123, 188, lab("10100",data), cex=small) - text(275, 152, lab("10010",data), cex=small) - text(137, 146, lab("10001",data), cex=small) - text(243, 268, lab("01100",data), cex=small) - text(175, 267, lab("01010",data), cex=small) - text(187, 117, lab("01001",data), cex=small) - text(286, 188, lab("00110",data), cex=small) - text(267, 235, lab("00101",data), cex=small) - text(228, 105, lab("00011",data), cex=small) - - text(148, 210, lab("11100",data),cex=small) - text(159, 253, lab("11010",data),cex=small) - text(171, 141, lab("11001",data),cex=small) - text(281, 175, lab("10110",data),cex=small) - text(143, 163, lab("10101",data),cex=small) - text(252, 145, lab("10011",data),cex=small) - text(205, 255, lab("01110",data),cex=small) - text(254, 243, lab("01101",data),cex=small) - text(211, 118, lab("01011",data),cex=small) - text(267, 211, lab("00111",data),cex=small) - - text(170, 231,lab("11110",data),cex=small) - text(158, 169,lab("11101",data),cex=small) - text(212, 139,lab("11011",data),cex=small) - text(263, 180,lab("10111",data),cex=small) - text(239, 232,lab("01111",data),cex=small) - - text(204,190,lab("11111",data)) - } - } - else { - stop(paste("The printing of ",numCircles," circles is not yet supported.")) - } - -} - - venn <- function(data, universe=NA, small=0.7, @@ -424,8 +129,8 @@ simplify=FALSE, show.plot=TRUE) { - counts <- getVennCounts(data) - + counts <- getVennCounts(data, universe=universe) + if(show.plot) drawVennDiagram(data=counts, small=small, @@ -433,5 +138,7 @@ simplify=simplify ) + invisible(counts) } + Modified: trunk/gplots/man/venn.Rd =================================================================== --- trunk/gplots/man/venn.Rd 2010-05-03 16:26:14 UTC (rev 1439) +++ trunk/gplots/man/venn.Rd 2010-06-11 03:11:16 UTC (rev 1440) @@ -2,74 +2,133 @@ \alias{venn} \title{Plot a Venn diagram} \description{ -Plot Venn diagrams for up to 5 sets + Plot a Venn diagrams for up to 5 sets } \usage{ venn(data, universe=NA, small=0.7, showSetLogicLabel=FALSE, simplify=FALSE, show.plot=TRUE) +\method{plot}{venn}(x, y, ..., small=0.7, showSetLogicLabel=FALSE, + simplify=FALSE) } \arguments{ - \item{data}{data to be plotted (see below)} - \item{universe}{??} - \item{small}{Character size of group labels} + \item{data}{Either a list list containing vectors of names or indices + of group members, or a data frame containing boolean indicators of + group membership (see below)} + \item{universe}{Subset of valid name/index elements. Values ignore values + in code{data} not in this list will be ignored. Use \code{NA} to + use all elements of \code{data} (the default).} + \item{small}{Character scaling of the smallest group counts} \item{showSetLogicLabel}{Logical flag indicating whether the internal group label should be displayed} - \item{simplify}{Logical flag indicating whether unobserved group + \item{simplify}{Logical flag indicating whether unobserved groups should be omitted.} \item{show.plot}{Logical flag indicating whether the plot should be displayed. If false, simply returns the group count matrix.} } \details{ \code{data} should be either a named list of vectors containing - indexes of group members (1, 2, 3,..) , or a data frame containing indicator - variables (TRUE, FALSE, TRUE, ..) for group membership. Group names - will be taken from the component vector or column names. + character string names ("GeneAABBB", "GeneBBBCY", .., "GeneXXZZ") or + indexes of group members (1, 2, .., N), or a data frame containing + indicator variables (TRUE, FALSE, TRUE, ..) for group membership. + Group names will be taken from the component list element or column + names. } \value{ - A matrix of all possible sets of groups, and the observed numer of - items beloinging to each set of groups is returned invisibly. - The fist column contains observed counts, subsequent columns contain - 0-1 indicators of group membership. + Invisibly returns an object of class "venn", containing a matrix of + all possible sets of groups, and the observed count of items belonging + to each The fist column contains observed counts, subsequent columns + contain 0-1 indicators of group membership. } -\author{Steffen Moeller \email{steffen\_mo...@gm...}, +\author{ + Steffen Moeller \email{steffen\_mo...@gm...}, with cleanup and packaging by Gregory R. Warnes - \email{gr...@ra...}.} + \email{gr...@wa...}.} \examples{ ## -## Example using a list of item indexes belonging to the +## Example using a list of item names belonging to the ## specified group. ## -A<- 1:20 -B<- 1:20 -C<- 2:20 -D<- 3:21 -input<-list(A,B,C,D) + +## construct some fake gene names.. +oneName <- function() paste(sample(LETTERS,5,replace=T),collapse="") +geneNames <- replicate(1000, oneName()) + +## +GroupA <- sample(geneNames, 400, replace=FALSE) +GroupB <- sample(geneNames, 750, replace=FALSE) +GroupC <- sample(geneNames, 250, replace=FALSE) +GroupD <- sample(geneNames, 300, replace=FALSE) +input <-list(GroupA,GroupB,GroupC,GroupD) input venn(input) + ## -## Example using a data frame of indicator columns +## Example using a list of item indexes belonging to the +## specified group. ## -A<- as.logical(rbinom(100, 1, 0.2)) -B<- as.logical(rbinom(100, 1, 0.7)) -C<- as.logical(rbinom(100, 1, 0.2)) -D<- as.logical(rbinom(100, 1, 0.1)) -input<-data.frame(A,B,C,D) -venn(input) +GroupA.i <- which(geneNames %in% GroupA) +GroupB.i <- which(geneNames %in% GroupB) +GroupC.i <- which(geneNames %in% GroupC) +GroupD.i <- which(geneNames %in% GroupD) +input.i <-list(A=GroupA.i,B=GroupB.i,C=GroupC.i,D=GroupD.i) +input.i +venn(input.i) -## Omit un-observed groupings -tmp <- venn(input, simplify=TRUE) +## +## Example using a data frame of indicator ('f'lag) columns +## +GroupA.f <- geneNames %in% GroupA +GroupB.f <- geneNames %in% GroupB +GroupC.f <- geneNames %in% GroupC +GroupD.f <- geneNames %in% GroupD +input.df <- data.frame(A=GroupA.f,B=GroupB.f,C=GroupC.f,D=GroupD.f) +head(input.df) +venn(input.df) -## show details +## smaller set to create empty groupings +small <- input[1:20,] + +venn(small, simplify=FALSE) # with empty groupings +venn(small, simplify=TRUE) # without empty groupings + +## Capture group counts, but don't plot +tmp <- venn(input, show.plot=FALSE) tmp ## Show internal binary group labels venn(input, showSetLogicLabel=TRUE) -## Specify universe -venn(input, universe=NULL, showSetLogicLabel=TRUE) +## Limit universe +tmp <- venn(input, universe=geneNames[1:100]) +tmp + +## +## Example to determine which elements are in A and B but not in +## C and D: first determine the universe, then form indicator columns +## and perform intersections on these. R allows using the set operations +## directly, but some might find this approach more intuitive. +## + +universe <- unique(c(GroupA,GroupB,GroupC,GroupD)) +GroupA.l <-universe %in% GroupA +GroupB.l <-universe %in% GroupB +GroupC.l <-universe %in% GroupC +GroupD.l <-universe %in% GroupD + +## Genes that are in GroupA and in GroupB but not in GroupD (unification +## of sets III0 and II00 in the venn diagram: +universe[GroupA.l & GroupB.l & !GroupD.l] + +## +## Alternatively: construct a function to test for the pattern you want. +## +test <- function(x) (x %in% GroupA) & (x %in% GroupB) & !(x %in% GroupC) +universe[ test(universe) ] + + } \keyword{hplot} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-05-03 16:26:20
|
Revision: 1439 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1439&view=rev Author: warnes Date: 2010-05-03 16:26:14 +0000 (Mon, 03 May 2010) Log Message: ----------- Rename installXLSXModules() to installXLSXsupport() and provide documentation for it. Modified Paths: -------------- trunk/gdata/NAMESPACE trunk/gdata/R/onAttach.R trunk/gdata/inst/NEWS trunk/gdata/man/xlsFormats.Rd Added Paths: ----------- trunk/gdata/R/installXLSXsupport.R trunk/gdata/man/installXLSXsupport.Rd Removed Paths: ------------- trunk/gdata/R/installXLSXModules.R Modified: trunk/gdata/NAMESPACE =================================================================== --- trunk/gdata/NAMESPACE 2010-05-03 13:48:39 UTC (rev 1438) +++ trunk/gdata/NAMESPACE 2010-05-03 16:26:14 UTC (rev 1439) @@ -11,7 +11,7 @@ elem, env, frameApply, - installXLSXModules, + installXLSXsupport, interleave, is.what, keep, Deleted: trunk/gdata/R/installXLSXModules.R =================================================================== --- trunk/gdata/R/installXLSXModules.R 2010-05-03 13:48:39 UTC (rev 1438) +++ trunk/gdata/R/installXLSXModules.R 2010-05-03 16:26:14 UTC (rev 1439) @@ -1,58 +0,0 @@ -## s$Id: read.xls.R 1423 2010-02-21 17:12:30Z ggrothendieck2 $ - -installXLSXModules <- function(perl="perl", verbose=FALSE) -{ - ## determine proper path to perl executable - perl <- if (missing(perl)) - findPerl(verbose = verbose) - else - findPerl(perl, verbose = verbose) - - ## - ## directories - package.dir <- .path.package('gdata') - perl.dir <- file.path(package.dir,'perl') - ## - ## - - cmd <- "install_modules.pl" - sc <- file.path(perl.dir, cmd) - - ## - ## - - ## - ## execution command - - cmd <- paste(perl, sc, sep=" ") - - ## - - if(verbose) - { - cat("\n") - cat("Attempting to automaticall install Perl libraries to support XLSX (Excel 2007+) file format...\n") - cat("\n") - } - - ## - - output <- system(cmd, intern=TRUE) - - ## - - if(verbose) cat("Results: ", output, "\n") - - ## - - if( "XLSX" %in% xlsFormats(perl=perl, verbose=verbose) ) - { - cat("\nPerl XLSX support libraries successfully installed.\n\n") - invisible(TRUE) - } - else - { - stop("\nUnable to install Perl XLSX support libraries.\n\n") - invisible(FALSE) - } -} Copied: trunk/gdata/R/installXLSXsupport.R (from rev 1438, trunk/gdata/R/installXLSXModules.R) =================================================================== --- trunk/gdata/R/installXLSXsupport.R (rev 0) +++ trunk/gdata/R/installXLSXsupport.R 2010-05-03 16:26:14 UTC (rev 1439) @@ -0,0 +1,58 @@ +## s$Id: read.xls.R 1423 2010-02-21 17:12:30Z ggrothendieck2 $ + +installXLSXsupport <- function(perl="perl", verbose=FALSE) +{ + ## determine proper path to perl executable + perl <- if (missing(perl)) + findPerl(verbose = verbose) + else + findPerl(perl, verbose = verbose) + + ## + ## directories + package.dir <- .path.package('gdata') + perl.dir <- file.path(package.dir,'perl') + ## + ## + + cmd <- "install_modules.pl" + sc <- file.path(perl.dir, cmd) + + ## + ## + + ## + ## execution command + + cmd <- paste(perl, sc, sep=" ") + + ## + + if(verbose) + { + cat("\n") + cat("Attempting to automaticall install Perl libraries to support XLSX (Excel 2007+) file format...\n") + cat("\n") + } + + ## + + output <- system(cmd, intern=TRUE) + + ## + + if(verbose) cat("Results: ", output, "\n") + + ## + + if( "XLSX" %in% xlsFormats(perl=perl, verbose=verbose) ) + { + cat("\nPerl XLSX support libraries successfully installed.\n\n") + invisible(TRUE) + } + else + { + stop("\nUnable to install Perl XLSX support libraries.\n\n") + invisible(FALSE) + } +} Modified: trunk/gdata/R/onAttach.R =================================================================== --- trunk/gdata/R/onAttach.R 2010-05-03 13:48:39 UTC (rev 1438) +++ trunk/gdata/R/onAttach.R 2010-05-03 16:26:14 UTC (rev 1439) @@ -67,9 +67,9 @@ show("\n") show( - " Run the function 'installXLSXModules()'", + " Run the function 'installXLSXsupport()'", " to automatically download and install the perl", - " libaries needed for Excel XLS and XLSX formats." + " libaries needed to support Excel XLS and XLSX formats." ) } Modified: trunk/gdata/inst/NEWS =================================================================== --- trunk/gdata/inst/NEWS 2010-05-03 13:48:39 UTC (rev 1438) +++ trunk/gdata/inst/NEWS 2010-05-03 16:26:14 UTC (rev 1439) @@ -12,10 +12,14 @@ If necessary perl libraries are not available, a warning message is displayed, as is a message suggesting the user run the (new) - installXLSXModules() function to attempt to install the necessary + installXLSXsupport() function to attempt to install the necessary perl libraries. +- The function function installXLSXsupport() has been provided to + install the binary perl modules that read.xls needs to support Excel + 2007+ 'XLSX' files. + CHANGES IN 2.7.3 (2010-04-02) ----------------------------- Added: trunk/gdata/man/installXLSXsupport.Rd =================================================================== --- trunk/gdata/man/installXLSXsupport.Rd (rev 0) +++ trunk/gdata/man/installXLSXsupport.Rd 2010-05-03 16:26:14 UTC (rev 1439) @@ -0,0 +1,68 @@ +\name{installXLSXsupport} +\Rdversion{1.1} +\alias{installXLSXsupport} +\title{ +Install perl modules needed for read.xls to support Excel 2007+ XLSX format +} +\description{ +Install perl modules needed for read.xls to support Excel 2007+ XLSX format +} +\usage{ +installXLSXsupport(perl = "perl", verbose = FALSE) +} +\arguments{ + \item{perl}{Path to perl interpreter (optional).} + \item{verbose}{If \code{TRUE}, show additional messages during + processing.} +} +\value{ + Either \code{TRUE} indicating that the necessary perl modules have + been successfully installed, or \code{FALSE} indicating that an error + has occured. +} +\details{ + + This function calls the perl script 'install_modules.pl' located in + the perl subdirectory of the gdata package directory (or inst/perl in + the source package). This perl script attempts to use the perl 'CPAN' + package, which should be included as part of most perl installations, + to automatically download, compile, and install the + Compress::Raw::Zlib and Spreadsheet::XLSX perl modules needed for + read.xls to support support Excel 2007+ XLSX files into the gdata + perl subdirectory. + + Since the perl modules are installed into the gdata installation + directory, the perl modules will be available until the gdata package + is replaced or removed. Since this occurs each time a new version of + gdata is installed, \code{installXLSXsupport} will need to be run each + time a new version of the gdata package is installed. + + Further, the binary Compress::Raw::Zlib package installed by + \code{installXLSXsupport} is tied to the particular version of perl + used to compile it, therefore, you will need to re-run + \code{installXLSXsupport} if you install a different perl + distribution. + + This installation process will fail if 1) perl is not available on the + search path and the \code{perl} argument is not used to specify the + path of the perl executable, 2) the perl installation is not properly + configured for installing binary packages*, 3) if the CPAN module is + not present, or 4) if the C compiler specified by the perl + installation is not present. + + \emph{In particular, \code{installXLSXsupport} will fail for the + version of perl included with the current RTools.zip package, which is + not correctly configured to allow installation of additional perl + packages. (The RTools version of perl is installed in a different + directory than the perl configuration files expect.)} + + The function \code{xlsFormats} can be used to see whether XLS and XLSX + formats are supported by the currently available perl modules. + } +\seealso{ + \code{\link{read.xls}}, \code{\link{xls2csv}}, \code{\link{xlsFormats}} +} +\examples{ + installXLSXsupport() +} +\keyword{ misc } Modified: trunk/gdata/man/xlsFormats.Rd =================================================================== --- trunk/gdata/man/xlsFormats.Rd 2010-05-03 13:48:39 UTC (rev 1438) +++ trunk/gdata/man/xlsFormats.Rd 2010-05-03 16:26:14 UTC (rev 1439) @@ -2,10 +2,10 @@ \Rdversion{1.1} \alias{xlsFormats} \title{ -Determine which XLS file formats are supported by read.xls +Check which file formats are supported by read.xls } \description{ -Determine which XLS file formats are supported by read.xls +Check which file formats are supported by read.xls } \usage{ xlsFormats(perl = "perl", verbose = FALSE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-05-03 13:48:48
|
Revision: 1438 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1438&view=rev Author: warnes Date: 2010-05-03 13:48:39 +0000 (Mon, 03 May 2010) Log Message: ----------- Update news for gdata 2.8.0 Modified Paths: -------------- trunk/gdata/inst/NEWS Modified: trunk/gdata/inst/NEWS =================================================================== --- trunk/gdata/inst/NEWS 2010-05-03 13:35:11 UTC (rev 1437) +++ trunk/gdata/inst/NEWS 2010-05-03 13:48:39 UTC (rev 1438) @@ -1,7 +1,45 @@ -CHANGES IN 2.7.0 (2010-02-19) +CHANGES IN 2.8.0 (2010-04-03) +----------------------------- Enhancements: +- When loaded, gtools (via an .onAttach() function) now checks: + 1) if perl is available + 2) whether the perl libraries for XLS support are available + 3) whether the perl libraries for XLSX support are available + + If perl is not available, an appropriate warning message is displayed. + + If necessary perl libraries are not available, a warning message is + displayed, as is a message suggesting the user run the (new) + installXLSXModules() function to attempt to install the necessary + perl libraries. + + +CHANGES IN 2.7.3 (2010-04-02) +----------------------------- + +Enhancements: + +- New xlsFormats() command to determine which Excel formats are + supported (XLS, XLSX). + +Bug Fixes: + +- No longer attempt to install perl modules Compress::Raw::Zlib and + Spreadsheet::XLSX at build/compile time. This should resolve recent + build issues, particularly on Windows. + +- All perl code can now operate (but generate warnings) when perl modules Compress::Raw::Zlib and + Spreadsheet::XLSX when are not installed. + +- Also update Greg's email address. + +CHANGES IN 2.7.1 (2010-02-19) +----------------------------- + +Enhancements: + - on Windows attempts to locate ActiveState perl if perl= not specified and Rtools perl would have otherwise been used in read.xls and other perl dependent functions. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-05-03 13:35:21
|
Revision: 1437 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1437&view=rev Author: warnes Date: 2010-05-03 13:35:11 +0000 (Mon, 03 May 2010) Log Message: ----------- Add .onAttach function to check & inform user if perl is available, to check whether XLS and XLSX formats are avaiable, and to run the (new) installXLSXModules() functon to attempt to install the necessar libraries if not. Added installXLSXModules() function. Modified Paths: -------------- trunk/gdata/DESCRIPTION trunk/gdata/NAMESPACE trunk/gdata/inst/perl/install_modules.pl trunk/gdata/inst/perl/module_tools.pl trunk/gdata/tests/test.read.xls.R Added Paths: ----------- trunk/gdata/R/installXLSXModules.R trunk/gdata/R/onAttach.R Modified: trunk/gdata/DESCRIPTION =================================================================== --- trunk/gdata/DESCRIPTION 2010-05-02 13:56:43 UTC (rev 1436) +++ trunk/gdata/DESCRIPTION 2010-05-03 13:35:11 UTC (rev 1437) @@ -3,8 +3,8 @@ Description: Various R programming tools for data manipulation Depends: R (>= 2.6.0) Imports: gtools -Version: 2.7.2 -Date: 2010-04-02 +Version: 2.8.0 +Date: 2010-04-03 Author: Gregory R. Warnes, with contributions from Ben Bolker, Gregor Gorjanc, Gabor Grothendieck, Ales Korosec, Thomas Lumley, Don MacQueen, Arni Magnusson, Jim Rogers, and others Modified: trunk/gdata/NAMESPACE =================================================================== --- trunk/gdata/NAMESPACE 2010-05-02 13:56:43 UTC (rev 1436) +++ trunk/gdata/NAMESPACE 2010-05-03 13:35:11 UTC (rev 1437) @@ -1,5 +1,6 @@ export( + .onAttach, Args, aggregate.table, bindData, @@ -10,6 +11,7 @@ elem, env, frameApply, + installXLSXModules, interleave, is.what, keep, Added: trunk/gdata/R/installXLSXModules.R =================================================================== --- trunk/gdata/R/installXLSXModules.R (rev 0) +++ trunk/gdata/R/installXLSXModules.R 2010-05-03 13:35:11 UTC (rev 1437) @@ -0,0 +1,58 @@ +## s$Id: read.xls.R 1423 2010-02-21 17:12:30Z ggrothendieck2 $ + +installXLSXModules <- function(perl="perl", verbose=FALSE) +{ + ## determine proper path to perl executable + perl <- if (missing(perl)) + findPerl(verbose = verbose) + else + findPerl(perl, verbose = verbose) + + ## + ## directories + package.dir <- .path.package('gdata') + perl.dir <- file.path(package.dir,'perl') + ## + ## + + cmd <- "install_modules.pl" + sc <- file.path(perl.dir, cmd) + + ## + ## + + ## + ## execution command + + cmd <- paste(perl, sc, sep=" ") + + ## + + if(verbose) + { + cat("\n") + cat("Attempting to automaticall install Perl libraries to support XLSX (Excel 2007+) file format...\n") + cat("\n") + } + + ## + + output <- system(cmd, intern=TRUE) + + ## + + if(verbose) cat("Results: ", output, "\n") + + ## + + if( "XLSX" %in% xlsFormats(perl=perl, verbose=verbose) ) + { + cat("\nPerl XLSX support libraries successfully installed.\n\n") + invisible(TRUE) + } + else + { + stop("\nUnable to install Perl XLSX support libraries.\n\n") + invisible(FALSE) + } +} Added: trunk/gdata/R/onAttach.R =================================================================== --- trunk/gdata/R/onAttach.R (rev 0) +++ trunk/gdata/R/onAttach.R 2010-05-03 13:35:11 UTC (rev 1437) @@ -0,0 +1,78 @@ +.onAttach <- function(libname, pkgname) + { + show <- function(...) + writeLines(strwrap( x=list(...), prefix="gdata: " )) + + + try( + { + + ## 1 - Can we access perl? + hasPerl <- try( findPerl(), silent=TRUE) + if(inherits(hasPerl, "try-error")) + show( + " + Unable to locate valid perl interpreter + \n + \n + read.xls() will be unable to read Excel XLS and XLSX files + unless the 'perl=' argument is used to specify the location of + a valid perl intrpreter. + \n + \n + (To avoid display of this message in the future, please ensure perl + is installed and available on the executable search path.) + ") + + + formats <- try(xlsFormats(),silent=TRUE) + msg <- FALSE + ## 2 - Are the libraries for XLS present? + if( !("XLS" %in% formats) ) + { + show( + "Unable to load perl libaries needed by read.xls()", + " to support 'XLX' (Excel 97-2004) files." + ) + msg <- TRUE + } + else + { + show( + "read.xls support for 'XLS' (Excel 97-2004) files ENABLED.") + } + + show("\n") + + ## 3 - Are the libbaries for XLSX present? + if( !("XLSX" %in% formats) ) + { + show( + "Unable to load perl libaries needed by read.xls()", + " to support 'XLSX' (Excel 2007+) files." + ) + msg <- TRUE + } + else + { + show( + "read.xls support for 'XLSX' (Excel 2007+) files ENABLED." + ) + } + + + + if(msg) + { + show("\n") + + show( + " Run the function 'installXLSXModules()'", + " to automatically download and install the perl", + " libaries needed for Excel XLS and XLSX formats." + ) + } + + }) + + } Modified: trunk/gdata/inst/perl/install_modules.pl =================================================================== --- trunk/gdata/inst/perl/install_modules.pl 2010-05-02 13:56:43 UTC (rev 1436) +++ trunk/gdata/inst/perl/install_modules.pl 2010-05-03 13:35:11 UTC (rev 1437) @@ -1,4 +1,11 @@ +#!/usr/bin/perl +BEGIN { + use File::Basename; + # Add current path to perl library search path + use lib dirname($0); +} + require 'module_tools.pl'; my( $HAS_Spreadsheet_ParseExcel, $HAS_Compress_Raw_Zlib, $HAS_Spreadsheet_XLSX); Modified: trunk/gdata/inst/perl/module_tools.pl =================================================================== --- trunk/gdata/inst/perl/module_tools.pl 2010-05-02 13:56:43 UTC (rev 1436) +++ trunk/gdata/inst/perl/module_tools.pl 2010-05-03 13:35:11 UTC (rev 1437) @@ -80,7 +80,7 @@ { my($mod, $obj, $here); - $here = getcwd(); + $here = dirname($0); # load the module require CPAN; Modified: trunk/gdata/tests/test.read.xls.R =================================================================== --- trunk/gdata/tests/test.read.xls.R 2010-05-02 13:56:43 UTC (rev 1436) +++ trunk/gdata/tests/test.read.xls.R 2010-05-03 13:35:11 UTC (rev 1437) @@ -1,5 +1,9 @@ library(gdata) +if ( ! 'XLSX' %in% xlsFormats() ) + { + try( installXLSXModules() ) + } # iris.xls is included in the gregmisc package for use as an example xlsfile <- file.path(.path.package('gdata'),'xls','iris.xls') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-05-02 13:56:49
|
Revision: 1436 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1436&view=rev Author: warnes Date: 2010-05-02 13:56:43 +0000 (Sun, 02 May 2010) Log Message: ----------- Correct error in xlsFormat example Modified Paths: -------------- trunk/gdata/man/xlsFormats.Rd Modified: trunk/gdata/man/xlsFormats.Rd =================================================================== --- trunk/gdata/man/xlsFormats.Rd 2010-05-02 06:11:26 UTC (rev 1435) +++ trunk/gdata/man/xlsFormats.Rd 2010-05-02 13:56:43 UTC (rev 1436) @@ -23,11 +23,6 @@ \code{\link{read.xls}}, \code{\link{xls2csv}}. } \examples{ - ## List supported formats xlsFormats() - - ## Example use - if( 'XLSX' \%in\% xlsFormats() ) # if XLSX is supported.. - sheetNames(exampleFile2007) } \keyword{ misc } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-05-02 06:11:33
|
Revision: 1435 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1435&view=rev Author: warnes Date: 2010-05-02 06:11:26 +0000 (Sun, 02 May 2010) Log Message: ----------- Update perl code to work (but generate warnings) when Zlib or SpreadSheet::XLXS is not instaled. Also update Greg's email address Modified Paths: -------------- trunk/gdata/DESCRIPTION trunk/gdata/NAMESPACE trunk/gdata/R/dQuote.ascii.R trunk/gdata/R/read.xls.R trunk/gdata/inst/doc/gregmisc.tex trunk/gdata/inst/perl/sheetCount.pl trunk/gdata/inst/perl/xls2csv.pl trunk/gdata/man/ConvertMedUnits.Rd trunk/gdata/man/aggregate.table.Rd trunk/gdata/man/combine.Rd trunk/gdata/man/interleave.Rd trunk/gdata/man/matchcols.Rd trunk/gdata/man/nobs.Rd trunk/gdata/man/read.xls.Rd trunk/gdata/man/rename.vars.Rd trunk/gdata/man/reorder.Rd trunk/gdata/man/resample.Rd trunk/gdata/man/sheetCount.Rd trunk/gdata/man/trim.Rd trunk/gdata/man/unmatrix.Rd trunk/gdata/man/upperTriangle.Rd trunk/gdata/tests/test.read.xls.R trunk/gdata/tests/test.read.xls.Rout.save trunk/gdata/tests/tests.write.fwf.Rout.save Added Paths: ----------- trunk/gdata/R/findPerl.R trunk/gdata/R/xlsFormats.R trunk/gdata/inst/perl/install_modules.pl trunk/gdata/inst/perl/module_tools.pl trunk/gdata/inst/perl/supportedFormats.pl trunk/gdata/man/xlsFormats.Rd Removed Paths: ------------- trunk/gdata/src/ Modified: trunk/gdata/DESCRIPTION =================================================================== --- trunk/gdata/DESCRIPTION 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/DESCRIPTION 2010-05-02 06:11:26 UTC (rev 1435) @@ -3,10 +3,10 @@ Description: Various R programming tools for data manipulation Depends: R (>= 2.6.0) Imports: gtools -Version: 2.7.1 -Date: 2010-01-27 +Version: 2.7.2 +Date: 2010-04-02 Author: Gregory R. Warnes, with contributions from Ben Bolker, Gregor Gorjanc, Gabor Grothendieck, Ales Korosec, Thomas Lumley, Don MacQueen, Arni Magnusson, Jim Rogers, and others -Maintainer: Gregory Warnes <gr...@ra...> +Maintainer: Gregory Warnes <gr...@wa...> License: GPL-2 Modified: trunk/gdata/NAMESPACE =================================================================== --- trunk/gdata/NAMESPACE 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/NAMESPACE 2010-05-02 06:11:26 UTC (rev 1435) @@ -36,7 +36,8 @@ xls2csv, xls2tab, xls2tsv, - xls2sep, + xls2sep, + xlsFormats, ## Object size stuff object.size, as.object_size, is.object_size, humanReadable, Modified: trunk/gdata/R/dQuote.ascii.R =================================================================== --- trunk/gdata/R/dQuote.ascii.R 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/R/dQuote.ascii.R 2010-05-02 06:11:26 UTC (rev 1435) @@ -7,25 +7,3 @@ ## dQuote.ascii <- function(x) paste('"',x,'"',sep='') -findPerl <- function(perl, verbose = "FALSE") { - - if (missing(perl)) { - if (.Platform$OS == "windows") { - perl <- Sys.which("perl") - if (perl == "") stop("perl not found. Use perl= argument.") - if (length(grep("rtools", tolower(perl))) > 0) { - perl.ftype <- shell("ftype perl", intern = TRUE) - if (length(grep("^perl=", perl.ftype)) > 0) { - perl <- sub('^perl="([^"]*)".*', "\\1", perl.ftype) - } - } - } - if (perl == "perl") perl <- Sys.which("perl") - } - - if (verbose) cat("Using perl at", perl, "\n") - - perl -} - - Added: trunk/gdata/R/findPerl.R =================================================================== --- trunk/gdata/R/findPerl.R (rev 0) +++ trunk/gdata/R/findPerl.R 2010-05-02 06:11:26 UTC (rev 1435) @@ -0,0 +1,34 @@ +## s$Id: read.xls.R 1342 2009-07-16 02:49:11Z warnes $ + +## findPerl attempts to locate a valid perl executable. If the 'perl' argument is missing, + + +findPerl <- function(perl, verbose = "FALSE") +{ + + errorMsg <- "perl executable not found. Use perl= argument to specify the correct path." + + if (missing(perl)) + { + perl = "perl" + } + + perl = Sys.which(perl) + if (perl=="" || perl=="perl") + stop(errorMsg) + + if (.Platform$OS == "windows") { + if (length(grep("rtools", tolower(perl))) > 0) { + perl.ftype <- shell("ftype perl", intern = TRUE) + if (length(grep("^perl=", perl.ftype)) > 0) { + perl <- sub('^perl="([^"]*)".*', "\\1", perl.ftype) + } + } + } + + if (verbose) cat("Using perl at", perl, "\n") + + perl +} + + Modified: trunk/gdata/R/read.xls.R =================================================================== --- trunk/gdata/R/read.xls.R 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/R/read.xls.R 2010-05-02 06:11:26 UTC (rev 1435) @@ -20,8 +20,11 @@ ## translate from xls to csv/tsv/tab format (returns name of created file) - perl <- if (missing(perl)) findPerl(verbose = verbose) - else findPerl(perl, verbose = verbose) + perl <- if (missing(perl)) + findPerl(verbose = verbose) + else + findPerl(perl, verbose = verbose) + con <- xls2sep(xls, sheet, verbose=verbose, ..., method=method, perl = perl) ## load the csv file Added: trunk/gdata/R/xlsFormats.R =================================================================== --- trunk/gdata/R/xlsFormats.R (rev 0) +++ trunk/gdata/R/xlsFormats.R 2010-05-02 06:11:26 UTC (rev 1435) @@ -0,0 +1,52 @@ +## s$Id: read.xls.R 1423 2010-02-21 17:12:30Z ggrothendieck2 $ + +xlsFormats <- function(perl="perl", verbose=FALSE) +{ + ## determine proper path to perl executable + perl <- if (missing(perl)) + findPerl(verbose = verbose) + else + findPerl(perl, verbose = verbose) + + ## + ## directories + package.dir <- .path.package('gdata') + perl.dir <- file.path(package.dir,'perl') + ## + ## + + cmd <- "supportedFormats.pl" + sc <- file.path(perl.dir, cmd) + + ## + ## + + ## + ## execution command + + cmd <- paste(perl, sc, sep=" ") + + ## + + if(verbose) + { + cat("\n") + cat("Determining supported formats...\n") + cat("\n") + } + + ## + + output <- system(cmd, intern=TRUE) + + ## + + if(verbose) cat("Results: ", output, "\n") + + ## + + retval <- unlist( strsplit(output," ")) + retval <- retval[ -c(1,2) ] + + return(retval) +} Modified: trunk/gdata/inst/doc/gregmisc.tex =================================================================== --- trunk/gdata/inst/doc/gregmisc.tex 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/inst/doc/gregmisc.tex 2010-05-02 06:11:26 UTC (rev 1435) @@ -96,7 +96,7 @@ \address{Gregory R. Warnes \\ Random Technologies LLC. \\ - \emph{gr...@ra...} } %%!!!%% + \emph{gr...@wa...} } %%!!!%% \end{multicols} %%!!!%% Added: trunk/gdata/inst/perl/install_modules.pl =================================================================== --- trunk/gdata/inst/perl/install_modules.pl (rev 0) +++ trunk/gdata/inst/perl/install_modules.pl 2010-05-02 06:11:26 UTC (rev 1435) @@ -0,0 +1,12 @@ + +require 'module_tools.pl'; + +my( $HAS_Spreadsheet_ParseExcel, $HAS_Compress_Raw_Zlib, $HAS_Spreadsheet_XLSX); + +# check if we need to do anything + +($HAS_Spreadsheet_ParseExcel, + $HAS_Compress_Raw_Zlib, + $HAS_Spreadsheet_XLSX) = check_modules(0); + +install_modules() unless $HAS_Compress_Raw_Zlib; Added: trunk/gdata/inst/perl/module_tools.pl =================================================================== --- trunk/gdata/inst/perl/module_tools.pl (rev 0) +++ trunk/gdata/inst/perl/module_tools.pl 2010-05-02 06:11:26 UTC (rev 1435) @@ -0,0 +1,108 @@ +#!/usr/bin/perl + +BEGIN { + use File::Basename; + # Add current path to perl library search path + use lib dirname($0); +} + +use strict; +use warnings; +use Data::Dumper; +use Cwd; + +sub check_modules(;$) + { + my( + $VERBOSE, + $HAS_Spreadsheet_ParseExcel, + $HAS_Compress_Raw_Zlib, + $HAS_Spreadsheet_XLSX + ); + $VERBOSE=$_[0]; + + # Check if we can load the libraries we need + eval + { + require Spreadsheet::ParseExcel; + $HAS_Spreadsheet_ParseExcel=1; + print "Loaded Spreadsheet::ParseExcel\n" if $VERBOSE; + + }; + eval + { + require Compress::Raw::Zlib; + $HAS_Compress_Raw_Zlib=1; + print "Loaded Compress::Raw::Zlib\n" if $VERBOSE; + }; + eval + { + require Spreadsheet::XLSX; + $HAS_Spreadsheet_XLSX=1; + print "Loaded Spreadsheet::XLSX\n" if $VERBOSE; + }; + + if($VERBOSE) + { + print "ERROR: Unable to load Spreadsheet::ParseExcel perl module! \n" + if !$HAS_Spreadsheet_ParseExcel; + print "ERROR: Unable to load Compress::Raw::Zlib perl module! \n" + if ! $HAS_Compress_Raw_Zlib; + print "ERROR: Unable to load Spreadsheet::XLSX perl module! \n" + if ! $HAS_Spreadsheet_XLSX; + } + + return $HAS_Spreadsheet_ParseExcel, $HAS_Compress_Raw_Zlib, $HAS_Spreadsheet_XLSX; + } + +sub check_modules_and_notify() + { + my( + $HAS_Spreadsheet_ParseExcel, + $HAS_Compress_Raw_Zlib, + $HAS_Spreadsheet_XLSX) = check_modules(0); + + $HAS_Spreadsheet_ParseExcel or + die("ERROR: Perl module Spreadsheet::ParseExcel cannot be loaded. Exiting.\n"); + + $HAS_Compress_Raw_Zlib or + warn("WARNING: Perl module Compress::Raw::Zlib cannot be loaded.\n"); + + $HAS_Spreadsheet_XLSX or + warn("WARNING: Perl module Spreadsheet::XLSX cannot be loaded.\n"); + + ($HAS_Compress_Raw_Zlib && $HAS_Spreadsheet_XLSX ) or + warn("WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed.\n"); + return $HAS_Spreadsheet_ParseExcel, $HAS_Compress_Raw_Zlib, $HAS_Spreadsheet_XLSX; + } + +sub install_modules() + { + my($mod, $obj, $here); + + $here = getcwd(); + + # load the module + require CPAN; + + # initialize CPAN components + CPAN::HandleConfig->load(); + CPAN::Shell::setup_output(); + CPAN::Index->reload(); + + # set the target install path + CPAN::Shell->o("conf", "makepl_arg", + "PREFIX=$here LIB=$here --prefix $here --install-base $here"); + CPAN::Shell->install("Compress::Raw::Zlib"); + + #return 0; + + # install the libraries we want + for $mod (qw( Compress::Raw::Zlib Spreadsheet::XLSX )){ + my $obj = CPAN::Shell->expand('Module',$mod); + $obj->install; + } + + } + +1; Property changes on: trunk/gdata/inst/perl/module_tools.pl ___________________________________________________________________ Added: svn:executable + * Modified: trunk/gdata/inst/perl/sheetCount.pl =================================================================== --- trunk/gdata/inst/perl/sheetCount.pl 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/inst/perl/sheetCount.pl 2010-05-02 06:11:26 UTC (rev 1435) @@ -7,8 +7,17 @@ } use strict; -use Spreadsheet::ParseExcel; -use Spreadsheet::XLSX; +## +# Try to load the modules we need +## +require 'module_tools.pl'; + +my( + $HAS_Spreadsheet_ParseExcel, + $HAS_Compress_Raw_Zlib, + $HAS_Spreadsheet_XLSX + ) = check_modules_and_notify(); + use File::Spec::Functions; # declare some varibles local Added: trunk/gdata/inst/perl/supportedFormats.pl =================================================================== --- trunk/gdata/inst/perl/supportedFormats.pl (rev 0) +++ trunk/gdata/inst/perl/supportedFormats.pl 2010-05-02 06:11:26 UTC (rev 1435) @@ -0,0 +1,26 @@ +#!/usr/bin/perl + +BEGIN { + use File::Basename; + # Add current path to perl library search path + use lib dirname($0); +} + +require 'module_tools.pl'; + +my( $HAS_Spreadsheet_ParseExcel, + $HAS_Compress_Raw_Zlib, + $HAS_Spreadsheet_XLSX) = check_modules(0); + +$XLS_Support = $HAS_Spreadsheet_ParseExcel; +$XLSX_Support = $HAS_Spreadsheet_ParseExcel && + $HAS_Compress_Raw_Zlib && + $HAS_Spreadsheet_XLSX; + +printf "Supported formats: "; +printf "XLS " if ( $XLS_Support ); +printf "XLSX" if ( $XLSX_Support ); +printf "\n"; + + + Modified: trunk/gdata/inst/perl/xls2csv.pl =================================================================== --- trunk/gdata/inst/perl/xls2csv.pl 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/inst/perl/xls2csv.pl 2010-05-02 06:11:26 UTC (rev 1435) @@ -7,13 +7,22 @@ } use strict; -use Spreadsheet::ParseExcel; -use Spreadsheet::XLSX; +#use Spreadsheet::ParseExcel; +#use Spreadsheet::XLSX; use POSIX; use File::Spec::Functions; +## +# Try to load the modules we need +## +require 'module_tools.pl'; +my( + $HAS_Spreadsheet_ParseExcel, + $HAS_Compress_Raw_Zlib, + $HAS_Spreadsheet_XLSX + ) = check_modules_and_notify(); + # declare some varibles local - my($row, $col, $sheet, $cell, $usage, $targetfile,$basename, $sheetnumber, $filename, $volume, $directories, $whoami, Modified: trunk/gdata/man/ConvertMedUnits.Rd =================================================================== --- trunk/gdata/man/ConvertMedUnits.Rd 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/man/ConvertMedUnits.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -46,7 +46,7 @@ \references{ \url{http://www.globalrph.com/conv_si.htm} } -\author{ Gregory R. Warnes \email{gr...@ra...} } +\author{ Gregory R. Warnes \email{gr...@wa...} } \examples{ data(MedUnits) Modified: trunk/gdata/man/aggregate.table.Rd =================================================================== --- trunk/gdata/man/aggregate.table.Rd 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/man/aggregate.table.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -49,7 +49,7 @@ Returns a matrix with one element for each combination of \code{by1} and \code{by2}. } -\author{ Gregory R. Warnes \email{gr...@ra...}} +\author{ Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link{aggregate}}, \code{\link{tapply}}, \code{\link{interleave}} } Modified: trunk/gdata/man/combine.Rd =================================================================== --- trunk/gdata/man/combine.Rd 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/man/combine.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -59,7 +59,7 @@ % ... % } %\references{ ~put references to the literature/web site here ~ } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} %\note{ ~~further notes~~ } \seealso{ \code{\link{rbind}}, \code{\link{merge}}} Modified: trunk/gdata/man/interleave.Rd =================================================================== --- trunk/gdata/man/interleave.Rd 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/man/interleave.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -66,7 +66,7 @@ \value{ Matrix containing the interleaved rows of the function arguments. } -\author{ Gregory R. Warnes \email{gr...@ra...} +\author{ Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link{cbind}}, \code{\link{rbind}}, \code{\link{combine}} } Modified: trunk/gdata/man/matchcols.Rd =================================================================== --- trunk/gdata/man/matchcols.Rd 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/man/matchcols.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -20,7 +20,7 @@ none of the patterns specified in \code{without}. } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link[base]{grep}} } \examples{ Modified: trunk/gdata/man/nobs.Rd =================================================================== --- trunk/gdata/man/nobs.Rd 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/man/nobs.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -58,7 +58,7 @@ A single numeric value or a vector of values (for data.frames) giving the number of non-missing values. } -\author{ Gregory R. Warnes \email{gr...@ra...} } +\author{ Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link{is.na}}, \code{\link{length}} } Modified: trunk/gdata/man/read.xls.Rd =================================================================== --- trunk/gdata/man/read.xls.Rd 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/man/read.xls.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -109,18 +109,21 @@ # see the number and names of sheets: sheetCount(exampleFile) - sheetNames(exampleFile2007) + if( 'XLSX' \%in\% xlsFormats() ) # if XLSX is supported.. + sheetNames(exampleFile2007) + data <- read.xls(exampleFile) # default is first worksheet data <- read.xls(exampleFile, sheet=2) # second worksheet by number data <- read.xls(exampleFile, sheet="Sheet Second",v=TRUE) # and by name # load the third worksheet, skipping the first two non-data lines... - data <- read.xls(exampleFile2007, sheet="Sheet with initial text", skip=2) + if( 'XLSX' \%in\% xlsFormats() ) # if XLSX is supported.. + data <- read.xls(exampleFile2007, sheet="Sheet with initial text", skip=2) } \author{ - Gregory R. Warnes \email{gr...@ra...}, + Gregory R. Warnes \email{gr...@wa...}, Jim Rogers \email{jam...@pf...}, and Gabor Grothendiek \email{ggr...@gm...}. } Modified: trunk/gdata/man/rename.vars.Rd =================================================================== --- trunk/gdata/man/rename.vars.Rd 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/man/rename.vars.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -49,7 +49,7 @@ } \author{Code by Don MacQueen \email{macq\@llnl.gov}. Documentation by Gregory R. Warnes - \email{gr...@ra...} } + \email{gr...@wa...} } \seealso{ \code{\link{names}}, \code{\link{colnames}}, \code{\link{data.frame}} Modified: trunk/gdata/man/reorder.Rd =================================================================== --- trunk/gdata/man/reorder.Rd 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/man/reorder.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -56,7 +56,7 @@ A new factor with reordered levels } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} \seealso{\code{\link{factor}} and \code{\link[stats]{reorder}}} Modified: trunk/gdata/man/resample.Rd =================================================================== --- trunk/gdata/man/resample.Rd 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/man/resample.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -27,7 +27,7 @@ \value{ Vector of the same length as the input, with the elements permuted. } -\author{Gregory R. Warnes \email{gr...@ra...} } +\author{Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link{sample}} } \examples{ Modified: trunk/gdata/man/sheetCount.Rd =================================================================== --- trunk/gdata/man/sheetCount.Rd 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/man/sheetCount.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -40,8 +40,10 @@ 'ExampleExcelFile.xlsx') sheetCount(exampleFile) - sheetNames(exampleFile2007) + if( 'XLSX' \%in\% xlsFormats() ) # if XLSX is supported.. + sheetNames(exampleFile2007) + } \keyword{ misc } Modified: trunk/gdata/man/trim.Rd =================================================================== --- trunk/gdata/man/trim.Rd 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/man/trim.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -32,7 +32,7 @@ \value{ \code{s} with all leading and trailing spaces removed in its elements. } -\author{Gregory R. Warnes \email{gr...@ra...} with +\author{Gregory R. Warnes \email{gr...@wa...} with contributions by Gregor Gorjanc} \seealso{ \code{\link[base]{sub}}, \code{\link[base]{gsub}} as well as argument \code{strip.white} in \code{\link{read.table}} and Modified: trunk/gdata/man/unmatrix.Rd =================================================================== --- trunk/gdata/man/unmatrix.Rd 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/man/unmatrix.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -19,7 +19,7 @@ matrix. If the the row or column names are missing, ('r1', 'r2', ..,) or ('c1', 'c2', ..) will be used as appropriate. } -\author{Gregory R. Warnes \email{gr...@ra...} } +\author{Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link[base]{as.vector}} } \examples{ # simple, useless example Modified: trunk/gdata/man/upperTriangle.Rd =================================================================== --- trunk/gdata/man/upperTriangle.Rd 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/man/upperTriangle.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -28,7 +28,7 @@ replace the upper or lower traingular area of the matrix with the provided value(s). } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link[base]{diag}} } \examples{ x <- matrix( 1:25, nrow=5, ncol=5) Added: trunk/gdata/man/xlsFormats.Rd =================================================================== --- trunk/gdata/man/xlsFormats.Rd (rev 0) +++ trunk/gdata/man/xlsFormats.Rd 2010-05-02 06:11:26 UTC (rev 1435) @@ -0,0 +1,33 @@ +\name{xlsFormats} +\Rdversion{1.1} +\alias{xlsFormats} +\title{ +Determine which XLS file formats are supported by read.xls +} +\description{ +Determine which XLS file formats are supported by read.xls +} +\usage{ +xlsFormats(perl = "perl", verbose = FALSE) +} +\arguments{ + \item{perl}{Path to perl interpreter (optional).} + \item{verbose}{If \code{TRUE}, show additional messages during + processing.} +} +\value{ + Vector of supported formats, possible elements are 'XLS' and 'XLSX'. +} + +\seealso{ + \code{\link{read.xls}}, \code{\link{xls2csv}}. +} +\examples{ + ## List supported formats + xlsFormats() + + ## Example use + if( 'XLSX' \%in\% xlsFormats() ) # if XLSX is supported.. + sheetNames(exampleFile2007) +} +\keyword{ misc } Modified: trunk/gdata/tests/test.read.xls.R =================================================================== --- trunk/gdata/tests/test.read.xls.R 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/tests/test.read.xls.R 2010-05-02 06:11:26 UTC (rev 1435) @@ -24,11 +24,15 @@ # see the number and names of sheets: sheetCount(exampleFile) -sheetCount(exampleFile2007) +if( 'XLSX' %in% xlsFormats() ) + sheetCount(exampleFile2007) + sheetNames(exampleFile) -sheetNames(exampleFile2007) +if( 'XLSX' %in% xlsFormats() ) + sheetNames(exampleFile2007) + example.1 <- read.xls(exampleFile, sheet=1) # default is first worksheet example.1 @@ -41,21 +45,24 @@ example.4 <- read.xls(exampleFile, sheet=3) # second worksheet by number example.4 -example.x.1 <- read.xls(exampleFile2007, sheet=1) # default is first worksheet -example.x.1 +if( 'XLSX' %in% xlsFormats() ) + { + example.x.1 <- read.xls(exampleFile2007, sheet=1) # default is first worksheet + print(example.x.1) -example.x.2 <- read.xls(exampleFile2007, sheet=2) # second worksheet by number -example.x.2 + example.x.2 <- read.xls(exampleFile2007, sheet=2) # second worksheet by number + print(example.x.2) -example.x.3 <- read.xls(exampleFile2007, sheet=3) # second worksheet by number -example.x.3 + example.x.3 <- read.xls(exampleFile2007, sheet=3) # second worksheet by number + print(example.x.3) -example.x.4 <- read.xls(exampleFile2007, sheet=3) # second worksheet by number -example.x.4 + example.x.4 <- read.xls(exampleFile2007, sheet=3) # second worksheet by number + print(example.x.4) -data <- read.xls(exampleFile2007, sheet="Sheet Second") # and by name -data - -# load the third worksheet, skipping the first two non-data lines... -data <- read.xls(exampleFile2007, sheet="Sheet with initial text", skip=2) -data + data <- read.xls(exampleFile2007, sheet="Sheet Second") # and by name + print(data) + + # load the third worksheet, skipping the first two non-data lines... + data <- read.xls(exampleFile2007, sheet="Sheet with initial text", skip=2) + print(data) +} Modified: trunk/gdata/tests/test.read.xls.Rout.save =================================================================== --- trunk/gdata/tests/test.read.xls.Rout.save 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/tests/test.read.xls.Rout.save 2010-05-02 06:11:26 UTC (rev 1435) @@ -1,6 +1,6 @@ -R version 2.10.1 (2009-12-14) -Copyright (C) 2009 The R Foundation for Statistical Computing +R version 2.11.0 (2010-04-22) +Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -21,17 +21,19 @@ Attaching package: 'gdata' +The following object(s) are masked from 'package:utils': - The following object(s) are masked from package:utils : + object.size - object.size - > > > # iris.xls is included in the gregmisc package for use as an example > xlsfile <- file.path(.path.package('gdata'),'xls','iris.xls') > > iris.1 <- read.xls(xlsfile) # defaults to csv format +WARNING: Perl module Compress::Raw::Zlib cannot be loaded. +WARNING: Perl module Spreadsheet::XLSX cannot be loaded. +WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. > iris.1 Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 setosa @@ -186,6 +188,9 @@ 150 5.9 3.0 5.1 1.8 virginica > > iris.2 <- read.xls(xlsfile,method="csv") # specify csv format +WARNING: Perl module Compress::Raw::Zlib cannot be loaded. +WARNING: Perl module Spreadsheet::XLSX cannot be loaded. +WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. > iris.2 Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 setosa @@ -340,6 +345,9 @@ 150 5.9 3.0 5.1 1.8 virginica > > iris.3 <- read.xls(xlsfile,method="tab") # specify tab format +WARNING: Perl module Compress::Raw::Zlib cannot be loaded. +WARNING: Perl module Spreadsheet::XLSX cannot be loaded. +WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. > iris.3 Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 setosa @@ -504,18 +512,28 @@ > > # see the number and names of sheets: > sheetCount(exampleFile) +WARNING: Perl module Compress::Raw::Zlib cannot be loaded. +WARNING: Perl module Spreadsheet::XLSX cannot be loaded. +WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. [1] 4 -> sheetCount(exampleFile2007) -[1] 4 > +> if( 'XLSX' %in% xlsFormats() ) ++ sheetCount(exampleFile2007) +> > sheetNames(exampleFile) +WARNING: Perl module Compress::Raw::Zlib cannot be loaded. +WARNING: Perl module Spreadsheet::XLSX cannot be loaded. +WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. [1] "Sheet First" "Sheet Second" [3] "Sheet with a very long name!" "Sheet with initial text" -> sheetNames(exampleFile2007) -[1] "Sheet First" "Sheet Second" -[3] "Sheet with a very long name!" "Sheet with initial text" > +> if( 'XLSX' %in% xlsFormats() ) ++ sheetNames(exampleFile2007) +> > example.1 <- read.xls(exampleFile, sheet=1) # default is first worksheet +WARNING: Perl module Compress::Raw::Zlib cannot be loaded. +WARNING: Perl module Spreadsheet::XLSX cannot be loaded. +WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. > example.1 A B C 1 1 1 1 @@ -527,6 +545,9 @@ 7 7 49 343 > > example.2 <- read.xls(exampleFile, sheet=2) # second worksheet by number +WARNING: Perl module Compress::Raw::Zlib cannot be loaded. +WARNING: Perl module Spreadsheet::XLSX cannot be loaded. +WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. > example.2 X D E F G Factor 1 FirstRow 1 NA NA NA Red @@ -535,6 +556,9 @@ 4 FourthRow 4 3 2 1 Black > > example.3 <- read.xls(exampleFile, sheet=3) # second worksheet by number +WARNING: Perl module Compress::Raw::Zlib cannot be loaded. +WARNING: Perl module Spreadsheet::XLSX cannot be loaded. +WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. > example.3 X1 X2001.01.01 X1.01 X0.205818150587141 X.DIV.0. A 1 2 2002-02-02 2:02 0.2910708 NA B @@ -548,6 +572,9 @@ 9 10 2010-10-10 10:10 0.6508541 0.0000000 A > > example.4 <- read.xls(exampleFile, sheet=3) # second worksheet by number +WARNING: Perl module Compress::Raw::Zlib cannot be loaded. +WARNING: Perl module Spreadsheet::XLSX cannot be loaded. +WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. > example.4 X1 X2001.01.01 X1.01 X0.205818150587141 X.DIV.0. A 1 2 2002-02-02 2:02 0.2910708 NA B @@ -560,68 +587,28 @@ 8 9 2009-09-09 9:09 0.6174545 0.0000000 A 9 10 2010-10-10 10:10 0.6508541 0.0000000 A > -> example.x.1 <- read.xls(exampleFile2007, sheet=1) # default is first worksheet -> example.x.1 - A B C -1 1 1 1 -2 2 4 8 -3 3 9 27 -4 4 16 64 -5 5 25 125 -6 6 36 216 -7 7 49 343 +> if( 'XLSX' %in% xlsFormats() ) ++ { ++ example.x.1 <- read.xls(exampleFile2007, sheet=1) # default is first worksheet ++ print(example.x.1) ++ ++ example.x.2 <- read.xls(exampleFile2007, sheet=2) # second worksheet by number ++ print(example.x.2) ++ ++ example.x.3 <- read.xls(exampleFile2007, sheet=3) # second worksheet by number ++ print(example.x.3) ++ ++ example.x.4 <- read.xls(exampleFile2007, sheet=3) # second worksheet by number ++ print(example.x.4) ++ ++ data <- read.xls(exampleFile2007, sheet="Sheet Second") # and by name ++ print(data) ++ ++ # load the third worksheet, skipping the first two non-data lines... ++ data <- read.xls(exampleFile2007, sheet="Sheet with initial text", skip=2) ++ print(data) ++ } > -> example.x.2 <- read.xls(exampleFile2007, sheet=2) # second worksheet by number -> example.x.2 - X D E F G Factor -1 FirstRow 1 NA NA NA Red -2 SecondRow 2 1 NA NA Green -3 ThirdRow 3 2 1 NA Red -4 FourthRow 4 3 2 1 Black -> -> example.x.3 <- read.xls(exampleFile2007, sheet=3) # second worksheet by number -> example.x.3 - X1 X2001.01.01 X1.01 X0.205818150587141 X.DIV.0. A -1 2 2002-02-02 2:02 0.2910708 NA B -2 3 2003-03-03 3:03 0.3564875 -0.8414710 C -3 4 2004-04-04 4:04 0.4116363 0.7080734 -4 5 2005-05-05 5:05 0.4602234 0.5013680 A -5 6 2006-06-06 6:06 NA 0.2513698 B -6 7 2007-07-07 7:07 0.5445436 0.0631868 B -7 8 2008-08-08 8:08 0.5821416 NA C -8 9 2009-09-09 9:09 0.6174545 0.0000000 A -9 10 2010-10-10 10:10 0.6508541 0.0000000 A -> -> example.x.4 <- read.xls(exampleFile2007, sheet=3) # second worksheet by number -> example.x.4 - X1 X2001.01.01 X1.01 X0.205818150587141 X.DIV.0. A -1 2 2002-02-02 2:02 0.2910708 NA B -2 3 2003-03-03 3:03 0.3564875 -0.8414710 C -3 4 2004-04-04 4:04 0.4116363 0.7080734 -4 5 2005-05-05 5:05 0.4602234 0.5013680 A -5 6 2006-06-06 6:06 NA 0.2513698 B -6 7 2007-07-07 7:07 0.5445436 0.0631868 B -7 8 2008-08-08 8:08 0.5821416 NA C -8 9 2009-09-09 9:09 0.6174545 0.0000000 A -9 10 2010-10-10 10:10 0.6508541 0.0000000 A -> -> data <- read.xls(exampleFile2007, sheet="Sheet Second") # and by name -> data - X D E F G Factor -1 FirstRow 1 NA NA NA Red -2 SecondRow 2 1 NA NA Green -3 ThirdRow 3 2 1 NA Red -4 FourthRow 4 3 2 1 Black -> -> # load the third worksheet, skipping the first two non-data lines... -> data <- read.xls(exampleFile2007, sheet="Sheet with initial text", skip=2) -> data - X X.1 D E F G Factor -1 NA FirstRow 1 NA NA NA Red -2 NA SecondRow 2 1 NA NA Green -3 NA ThirdRow 3 2 1 NA Red -4 NA FourthRow 4 3 2 1 Black -> > proc.time() user system elapsed - 2.787 2.477 3.347 + 1.350 0.285 1.659 Modified: trunk/gdata/tests/tests.write.fwf.Rout.save =================================================================== --- trunk/gdata/tests/tests.write.fwf.Rout.save 2010-05-01 22:14:05 UTC (rev 1434) +++ trunk/gdata/tests/tests.write.fwf.Rout.save 2010-05-02 06:11:26 UTC (rev 1435) @@ -27,7 +27,7 @@ Attaching package: 'gdata' - The following object(s) are masked from package:utils : +The following object(s) are masked from package:utils : object.size This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-05-01 22:14:13
|
Revision: 1434 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1434&view=rev Author: warnes Date: 2010-05-01 22:14:05 +0000 (Sat, 01 May 2010) Log Message: ----------- Update version number for new release Modified Paths: -------------- trunk/gtools/DESCRIPTION Modified: trunk/gtools/DESCRIPTION =================================================================== --- trunk/gtools/DESCRIPTION 2010-05-01 22:03:03 UTC (rev 1433) +++ trunk/gtools/DESCRIPTION 2010-05-01 22:14:05 UTC (rev 1434) @@ -1,8 +1,8 @@ Package: gtools Title: Various R programming tools Description: Various R programming tools -Version: 2.6.1 -Date: 2009-05-08 +Version: 2.6.2 +Date: 2010-05-01 Author: Gregory R. Warnes. Includes R source code and/or documentation contributed by Ben Bolker and Thomas Lumley Maintainer: Gregory R. Warnes <gr...@wa...> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-05-01 22:03:10
|
Revision: 1433 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1433&view=rev Author: warnes Date: 2010-05-01 22:03:03 +0000 (Sat, 01 May 2010) Log Message: ----------- Change Greg's email address to gr...@wa... Modified Paths: -------------- trunk/gtools/DESCRIPTION trunk/gtools/man/addLast.Rd trunk/gtools/man/ask.Rd trunk/gtools/man/binsearch.Rd trunk/gtools/man/capture.Rd trunk/gtools/man/combinations.Rd trunk/gtools/man/defmacro.Rd trunk/gtools/man/dirichlet.Rd trunk/gtools/man/foldchange.Rd trunk/gtools/man/invalid.Rd trunk/gtools/man/keywords.Rd trunk/gtools/man/logit.Rd trunk/gtools/man/mixedsort.Rd trunk/gtools/man/oddeven.Rd trunk/gtools/man/permute.Rd trunk/gtools/man/quantcut.Rd trunk/gtools/man/running.Rd trunk/gtools/man/scat.Rd trunk/gtools/man/setTCPNoDelay.Rd trunk/gtools/man/smartbind.Rd Modified: trunk/gtools/DESCRIPTION =================================================================== --- trunk/gtools/DESCRIPTION 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/DESCRIPTION 2010-05-01 22:03:03 UTC (rev 1433) @@ -5,5 +5,5 @@ Date: 2009-05-08 Author: Gregory R. Warnes. Includes R source code and/or documentation contributed by Ben Bolker and Thomas Lumley -Maintainer: Gregory R. Warnes <gr...@ra...> +Maintainer: Gregory R. Warnes <gr...@wa...> License: LGPL-2.1 Modified: trunk/gtools/man/addLast.Rd =================================================================== --- trunk/gtools/man/addLast.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/addLast.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -20,7 +20,7 @@ \value{ None. } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link[base]{.Last}} } \examples{ Modified: trunk/gtools/man/ask.Rd =================================================================== --- trunk/gtools/man/ask.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/ask.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -18,7 +18,7 @@ \value{ A character scalar containing the input providede by the user. } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link{readLines}}, \code{\link{scan}} } \examples{ Modified: trunk/gtools/man/binsearch.Rd =================================================================== --- trunk/gtools/man/binsearch.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/binsearch.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -60,7 +60,7 @@ \code{where}.} } %\references{ ~put references to the literature/web site here ~ } -\author{Gregory R. Warnes \email{gr...@ra...} } +\author{Gregory R. Warnes \email{gr...@wa...} } \note{This function often returns two values for \code{where} and \code{value}. Be sure to check the \code{flag} parameter to see what these values mean.} Modified: trunk/gtools/man/capture.Rd =================================================================== --- trunk/gtools/man/capture.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/capture.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -30,7 +30,7 @@ \section{WARNING}{R 1.7.0+ includes \code{capture.output}, which duplicates the functionality of \code{capture}. Thus, \code{capture} is depreciated.} -\author{Gregory R. Warnes \email{gr...@ra...} } +\author{Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link[session]{texteval}}, \code{\link{capture.output}} Modified: trunk/gtools/man/combinations.Rd =================================================================== --- trunk/gtools/man/combinations.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/combinations.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -40,7 +40,7 @@ \author{ Original versions by Bill Venables \email{Bil...@cm...}. Extended to handle \code{repeats.allowed} by Gregory R. Warnes - \email{gr...@ra...}. + \email{gr...@wa...}. } \seealso{ \code{\link[base]{choose}}, \code{\link[base]{options}} } \examples{ Modified: trunk/gtools/man/defmacro.Rd =================================================================== --- trunk/gtools/man/defmacro.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/defmacro.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -64,7 +64,7 @@ No. 3, pp 11--13, \url{http://CRAN.R-project.org/doc/Rnews/} } \author{ Thomas Lumley wrote \code{defmacro}. Gregory R. Warnes - \email{gr...@ra...} enhanced it and created + \email{gr...@wa...} enhanced it and created \code{strmacro}. } \seealso{ Modified: trunk/gtools/man/dirichlet.Rd =================================================================== --- trunk/gtools/man/dirichlet.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/dirichlet.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -36,7 +36,7 @@ \url{http://www.r-project.org/nocvs/mail/r-help/2000/3865.html}. Ben attributed the code to Ian Wilson \email{i.w...@ma...}. Subsequent modifications by Gregory R. Warnes - \email{gr...@ra...}. + \email{gr...@wa...}. } \seealso{ \code{\link{dbeta}}, \code{\link{rbeta}} } \examples{ Modified: trunk/gtools/man/foldchange.Rd =================================================================== --- trunk/gtools/man/foldchange.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/foldchange.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -37,7 +37,7 @@ A vector or matrix of the same dimensions as the input containing the converted values. } -\author{ Gregory R. Warnes \email{gr...@ra...} } +\author{ Gregory R. Warnes \email{gr...@wa...} } \examples{ a <- 1:21 Modified: trunk/gtools/man/invalid.Rd =================================================================== --- trunk/gtools/man/invalid.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/invalid.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -17,7 +17,7 @@ \value{ Logical value. } -\author{Gregory R. Warnes \email{gr...@ra...} } +\author{Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link[base]{missing}}, \code{\link[base]{is.na}}, \code{\link[base]{is.null}} } \examples{ Modified: trunk/gtools/man/keywords.Rd =================================================================== --- trunk/gtools/man/keywords.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/keywords.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -17,7 +17,7 @@ \value{ Nothing of interest. } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link[utils]{help}} } \examples{ keywords() Modified: trunk/gtools/man/logit.Rd =================================================================== --- trunk/gtools/man/logit.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/logit.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -42,7 +42,7 @@ \value{ Transformed value(s). } -\author{ Gregory R. Warnes \email{gr...@ra...} } +\author{ Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link[car]{logit}}, \code{\link[moc]{inv.glogit}} } \examples{ Modified: trunk/gtools/man/mixedsort.Rd =================================================================== --- trunk/gtools/man/mixedsort.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/mixedsort.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -36,7 +36,7 @@ \code{mixedorder} returns a vector giving the sort order of the input elements. \code{mixedsort} returns the sorted vector. } -\author{ Gregory R. Warnes \email{gr...@ra...} } +\author{ Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link[base]{sort}}, \code{\link[base]{order}} } \examples{ # compound & dose labels Modified: trunk/gtools/man/oddeven.Rd =================================================================== --- trunk/gtools/man/oddeven.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/oddeven.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -17,7 +17,7 @@ \value{ Vector of TRUE/FALSE values. } -\author{ Gregory R. Warnes \email{gr...@ra...}} +\author{ Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link[base]{round}} } \examples{ Modified: trunk/gtools/man/permute.Rd =================================================================== --- trunk/gtools/man/permute.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/permute.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -18,7 +18,7 @@ \value{ Vector with the original items reordered. } -\author{ Gregory R. Warnes \email{gr...@ra...} } +\author{ Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link{sample}} } \examples{ Modified: trunk/gtools/man/quantcut.Rd =================================================================== --- trunk/gtools/man/quantcut.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/quantcut.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -34,7 +34,7 @@ Factor variable with one level for each quantile interval given by \code{q}. } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link{cut}}, \code{\link{quantile}} } Modified: trunk/gtools/man/running.Rd =================================================================== --- trunk/gtools/man/running.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/running.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -55,7 +55,7 @@ Note that this function will create a vector or matrix even for objects which are not simplified by \code{sapply}. } -\author{ Gregory R. Warnes \email{gr...@ra...}, +\author{ Gregory R. Warnes \email{gr...@wa...}, with contributions by Nitin Jain \email{nit...@pf...}.} \seealso{ \code{\link[gplots]{wapply}} to apply a function over an x-y window centered at each x point, \code{\link[base]{sapply}}, Modified: trunk/gtools/man/scat.Rd =================================================================== --- trunk/gtools/man/scat.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/scat.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -18,7 +18,7 @@ \value{ NULL (invisibly) } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link[base]{cat}}} \examples{ options(DEBUG=NULL) # makee sure DEBUG isn't set Modified: trunk/gtools/man/setTCPNoDelay.Rd =================================================================== --- trunk/gtools/man/setTCPNoDelay.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/setTCPNoDelay.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -39,7 +39,7 @@ Request for Comments 896, January 1984. \url{http://www.ietf.org/rfc/rfc0896.txt?number=896} } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link{make.socket}}, \code{\link{socketConnection}} Modified: trunk/gtools/man/smartbind.Rd =================================================================== --- trunk/gtools/man/smartbind.Rd 2010-05-01 21:59:48 UTC (rev 1432) +++ trunk/gtools/man/smartbind.Rd 2010-05-01 22:03:03 UTC (rev 1433) @@ -22,7 +22,7 @@ character strings. The user will need to coerce such character columns into an appropriate type. } -\author{Gregory R. Warnes \email{gr...@ra...}} +\author{Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link{rbind}}, \code{\link{cbind}} } \examples{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2010-05-01 21:59:54
|
Revision: 1432 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1432&view=rev Author: warnes Date: 2010-05-01 21:59:48 +0000 (Sat, 01 May 2010) Log Message: ----------- Fix error in checkRVersion() Modified Paths: -------------- trunk/gtools/R/checkRVersion.R Modified: trunk/gtools/R/checkRVersion.R =================================================================== --- trunk/gtools/R/checkRVersion.R 2010-04-28 17:23:08 UTC (rev 1431) +++ trunk/gtools/R/checkRVersion.R 2010-05-01 21:59:48 UTC (rev 1432) @@ -9,7 +9,7 @@ if(!quiet) { cat("A newer version of R is now available: ") - cat(max(versionList)) + cat(as.character(max(versionList))) cat("\n") } invisible( max(versionList) ) @@ -19,7 +19,7 @@ if(!quiet) { cat("The latest version of R is installed: ") - cat(as.character(getRversion())) + cat(as.character(max(versionList))) cat("\n") } invisible( NULL ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |