From 9bc3c61e1fba79d0811d5f919d8326084c4a75c9 Mon Sep 17 00:00:00 2001 From: Marc Schwartz Date: Wed, 12 Feb 2014 12:10:33 -0600 Subject: [PATCH] Modified the code to use system.file() rather than path.package() to enable the use of WriteXLS() when the package is not loaded. Bumping to v3.4.0. --- DESCRIPTION | 4 ++-- R/WriteXLS.R | 2 +- R/testPerl.R | 2 +- man/WriteXLS.Rd | 3 +-- man/testPerl.Rd | 3 +-- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ce3a367..e1c48db 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: WriteXLS -Version: 3.3.1 -Date: 2014-01-20 +Version: 3.4.0 +Date: 2014-02-12 Title: Cross-platform Perl based R function to create Excel 2003 (XLS) and Excel 2007 (XLSX) files Description: Cross-platform Perl based R function to create Excel 2003 (XLS) and Excel 2007 (XLSX) files from one or more data frames. Each data frame will be diff --git a/R/WriteXLS.R b/R/WriteXLS.R index 65fa52b..ba190e7 100644 --- a/R/WriteXLS.R +++ b/R/WriteXLS.R @@ -128,7 +128,7 @@ WriteXLS <- function(x, ExcelFileName = "R.xls", SheetNames = NULL, perl = "perl } # Get path to WriteXLS.pl or WriteXLSX.pl - Perl.Path <- file.path(path.package("WriteXLS"), "Perl") + Perl.Path <- system.file("Perl", package = "WriteXLS") PerlScript <- ifelse(XLSX, "WriteXLSX.pl", "WriteXLS.pl") diff --git a/R/testPerl.R b/R/testPerl.R index 6c165e1..e9aea43 100644 --- a/R/testPerl.R +++ b/R/testPerl.R @@ -14,7 +14,7 @@ testPerl <- function(perl = "perl", verbose = TRUE) require(WriteXLS) # Get path to WriteXLS Perl tree - Perl.Path <- file.path(path.package("WriteXLS"), "Perl") + Perl.Path <- system.file("Perl", package = "WriteXLS") # Check For Perl first res <- Sys.which(perl) diff --git a/man/WriteXLS.Rd b/man/WriteXLS.Rd index 03eb494..bf62fab 100644 --- a/man/WriteXLS.Rd +++ b/man/WriteXLS.Rd @@ -155,8 +155,7 @@ directory) for additional details on meeting the requirements for Perl and the additional Perl modules that are necessary for this function to work properly. The file includes platform specific recommendations for common scenarios. The path to the package - installation directory can be located using \code{path.package("WriteXLS")} after using - \code{library(WriteXLS)}. + installation directory can be located using \code{system.file(package = "WriteXLS")}. A working installed version of Perl must be present in the current system searchpath or the exact path of the perl executable diff --git a/man/testPerl.Rd b/man/testPerl.Rd index 3a736a1..c30fb5d 100644 --- a/man/testPerl.Rd +++ b/man/testPerl.Rd @@ -24,8 +24,7 @@ directory) for additional details on meeting the requirements for Perl and the additional Perl modules that are necessary for \code{WriteXLS} to work properly. The file includes platform specific recommendations for common scenarios. The path to the package - installation directory can be located using \code{path.package("WriteXLS")} after using - \code{library(WriteXLS)}. + installation directory can be located using \code{system.file(package = "WriteXLS")}. A working installed version of Perl must be present in the current system searchpath or the exact path of the perl executable