[R-gregmisc-users] SF.net SVN: r-gregmisc:[1439] trunk/gdata
Brought to you by:
warnes
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. |