installXLSXsupport: Install perl modules needed for read.xls to support Excel...

Description Usage Arguments Details Value See Also Examples

View source: R/installXLSXsupport.R

Description

Install perl modules needed for read.xls to support Excel 2007+ XLSX format

Usage

1
installXLSXsupport(perl = "perl", verbose = FALSE)

Arguments

perl

Path to perl interpreter (optional).

verbose

If TRUE, show additional messages during processing.

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, 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 installXLSXsupport is tied to the particular version of perl used to compile it, therefore, you will need to re-run 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 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.

In particular, 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 xlsFormats can be used to see whether XLS and XLSX formats are supported by the currently available perl modules.

Value

Either TRUE indicating that the necessary perl modules have been successfully installed, or FALSE indicating that an error has occured.

See Also

read.xls, xls2csv, xlsFormats

Examples

1
2
3
4
## Not run: 
   installXLSXsupport()

## End(Not run)

Example output

gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED.

gdata: read.xls support for 'XLSX' (Excel 2007+) files ENABLED.

Attaching package: 'gdata'

The following object is masked from 'package:stats':

    nobs

The following object is masked from 'package:utils':

    object.size

The following object is masked from 'package:base':

    startsWith


Perl XLSX support libraries successfully installed.

gdata documentation built on May 2, 2019, 5:49 p.m.