[Rd] odbcConnectExcel on non-Windows?

2009-08-09 Thread spencerg
Hello: 



 What should I do regarding code to write an Excel file in a 
non-Windows platform? 



 The sos package [new version of RSiteSearch] on R-Forge 
includes writeFindFn2xls, which starts with require(RODBC).  The 
next line calls odbcConnectExcel.  This works under Windows but fails 
under Linux and MacOS. 



 What would you suggest we do about this? 



 It currently tests (.Platform$OS.type == windows);  if(FALSE), 
it issues an error, saying that it only works under Windows.  Also, the 
help page skips those tests if the the platform is not Windows. 



 If there is a better way to handle this, I would like to know. 



 Thanks,
 Spencer

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] odbcConnectExcel on non-Windows?

2009-08-09 Thread Dirk Eddelbuettel

On 9 August 2009 at 12:04, spencerg wrote:
|   What should I do regarding code to write an Excel file in a 
| non-Windows platform? 
[...]
|   What would you suggest we do about this? 
[...] 
|   If there is a better way to handle this, I would like to know. 

http://cran.r-project.org/web/packages/WriteXLS/index.html

Portable (in the sense of used by Perl, Python, ... or other scripting
engines) solutions have existed for a dozen years.  We have a wrapper to Perl
code for a long time too (having been of the initial discussions that lead to
Greg's initial read.xls from the gdata package).

Dirk

-- 
Three out of two people have difficulties with fractions.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] odbcConnectExcel on non-Windows?

2009-08-09 Thread Gabor Grothendieck
Instead of writing out an xls file you could write out a file
in any format that Excel can read, e.g. csv, with a suitable
renaming of your function.

On Sun, Aug 9, 2009 at 1:04 PM, spencergspencer.gra...@prodsyse.com wrote:
 Hello:

     What should I do regarding code to write an Excel file in a non-Windows
 platform?

     The sos package [new version of RSiteSearch] on R-Forge includes
 writeFindFn2xls, which starts with require(RODBC).  The next line calls
 odbcConnectExcel.  This works under Windows but fails under Linux and
 MacOS.

     What would you suggest we do about this?

     It currently tests (.Platform$OS.type == windows);  if(FALSE), it
 issues an error, saying that it only works under Windows.  Also, the help
 page skips those tests if the the platform is not Windows.

     If there is a better way to handle this, I would like to know.

     Thanks,
     Spencer

 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] odbcConnectExcel on non-Windows?

2009-08-09 Thread spencerg
Dear Marc: 



 In spite of your efforts to help me, I still get an F in your 
WriteXLS class.  Consider the following: 



 library(WriteXLS)
 help(pac=WriteXLS)
 testPerl()
Perl found.

The following Perl modules were not found on this system:

Text::CSV_XS

If you have more than one Perl installation, be sure the correct one was 
used here.


Otherwise, please install the missing modules. See the package INSTALL 
file for more information.


##

 Might it be feasible to include the required Perl modules with the 
WriteXLS package?  Then you would not have to rely on fools like me 
not knowing how to get the preferred copy of any required Perl modules. 



 On my Windows platform (Vista), I got RODBC to work for 
writeFindFn2xls in the sos package.  Unfortunately, the daily 
checks on R-Forge failed on non-Windows platforms.  When I saw that, I 
asked R-Devel for help.  Dirk suggested I try WriteXLS;  see below. 



 What do you suggest? 



 If I don't hear an answer, I propose to NOT add WriteXLS to the 
DESCRIPTION file but rather to modify the code for writeFindFn2xls 
so that on non-Windows platforms, it tests to see if WriteXLS is 
installed.  If no, it will issue an appropriate error message.  If it 
finds WriteXLS, it will try to use it. 



 However, if you have other suggestions, I'd be pleased to hear them. 



 Best Wishes,
 Spencer Graves


 sessionInfo()
R version 2.9.1 (2009-06-26)
i386-pc-mingw32

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United 
States.1252;LC_MONETARY=English_United 
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252


attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base


other attached packages:
[1] sos_1.0-5  brew_1.0-3 WriteXLS_1.8.1
###

Dirk Eddelbuettel wrote:

On 9 August 2009 at 12:04, spencerg wrote:
|   What should I do regarding code to write an Excel file in a 
| non-Windows platform? 
[...]
|   What would you suggest we do about this? 
[...] 
|   If there is a better way to handle this, I would like to know. 


http://cran.r-project.org/web/packages/WriteXLS/index.html

Portable (in the sense of used by Perl, Python, ... or other scripting
engines) solutions have existed for a dozen years.  We have a wrapper to Perl
code for a long time too (having been of the initial discussions that lead to
Greg's initial read.xls from the gdata package).

Dirk




__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] odbcConnectExcel on non-Windows?

2009-08-09 Thread spencerg
Dear Gabor: 

 Good suggestion.  I will probably do that if WriteXLS is not 
installed or if it is but testPerl() is FALSE. 


 Thanks,
 Spencer

Gabor Grothendieck wrote:

Instead of writing out an xls file you could write out a file
in any format that Excel can read, e.g. csv, with a suitable
renaming of your function.

On Sun, Aug 9, 2009 at 1:04 PM, spencergspencer.gra...@prodsyse.com wrote:
  

Hello:

What should I do regarding code to write an Excel file in a non-Windows
platform?

The sos package [new version of RSiteSearch] on R-Forge includes
writeFindFn2xls, which starts with require(RODBC).  The next line calls
odbcConnectExcel.  This works under Windows but fails under Linux and
MacOS.

What would you suggest we do about this?

It currently tests (.Platform$OS.type == windows);  if(FALSE), it
issues an error, saying that it only works under Windows.  Also, the help
page skips those tests if the the platform is not Windows.

If there is a better way to handle this, I would like to know.

Thanks,
Spencer

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel







__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel