[R] WriteXLS problem

David Winsemius dwinsemius at comcast.net
Mon Sep 6 18:34:59 CEST 2010


On Sep 6, 2010, at 12:25 PM, Kenneth Roy Cabrera Torres wrote:

> Thank you Ivan for you answer:
> El lun, 06-09-2010 a las 18:11 +0200, Ivan Calandra escribió:
>> Hi,
>>
>> Are you sure you used the correct syntax and object names? It might  
>> just
>> be because of that...(reading the error messages)
> Im sure, because it works with write.csv or write.table.

Sure? You are making the incorrect assumption that those write  
functions have the same syntax. At least for WriteXLS that assumption  
is false. The help page clearly states that the objects need to be  
quoted rather than being referred to by their "naked" names. The error  
you are getting with your "second option" suggests to me that you  
offered an unquoted name of an object.

You can offer a vector of quoted names of dataframes to WriteXLS and  
each named dataframe will be converted to a worksheet within the  
workbook.

-- 
David.


>> There is another function, xlsReadWrite::write.xls(), that I like a  
>> lot:
>> it is really easy to use and does not require Perl or Python.
> Unfortunately it works on windows, and I am in a non windows platform
> (ubuntu).
>
> Thank you for you advice and help.
>
> Kenneth
>>
>> HTH,
>> Ivan
>>
>> Le 9/6/2010 18:03, Kenneth Roy Cabrera Torres a crit :
>>> Hi R users:
>>>
>>> I don't know if you have had the following problem trying to
>>> export to an "xls" format file in a non windows platform.
>>>
>>> I try to use the following packages:
>>> 1. dataframes2xls (version 0.4.4) (with phyton 2.7 and 3.1)
>>> 2. WriteXLS (version 1.9.0) (with perl and testPerl working)
>>>
>>> Even "xlsx" package that take too long and do not finish.
>>>
>>> The data frame I try to export has 269363 row and 116 columns.
>>> In the first one (dataframe2xls) I get this message:
>>>
>>> Traceback (most recent call last):
>>>  File
>>> "C:/PROGRA~2/R/R-211~1.1PA/library/dataframes2xls/python/ 
>>> csv2xls.py",
>>> line 18, in<module>
>>> import pyexcelerator
>>> File
>>> "C:\PROGRA~2\R\R-211~1.1PA\library\dataframes2xls\python 
>>> \pyexcelerator
>>> \__init__.py",
>>> line 12, in<module>      from Workbook import Workbook
>>> File
>>> "C:\PROGRA~2\R\R-211~1.1PA\library\dataframes2xls\python 
>>> \pyexcelerator
>>> \Workbook.py",
>>> line 526     boundsheets_len +=  
>>> len(BIFFRecords.BoundSheetRecord(0x00L,
>>> sheet.hidden, sheet.name).get())
>>>                                                             ^
>>> SyntaxError: invalid syntax
>>>
>>> Using the second option I get this message:
>>>
>>> Error en get(as.character(i)),envr=envir) :
>>>   objeto '00000000089' no encontrado
>>>
>>> Object '00000000089' not found.
>>>
>>> Im using this R platform:
>>> sessionInfo()
>>> R version 2.11.1 Patched (2010-08-30 r52848)
>>> Platform: x86_64-unknown-linux-gnu (64-bit)
>>>
>>> Locale:
>>> LC_CTYPE=es_CO.UTF-8
>>>
>>> Is the only solution to export to ".csv" and then
>>> to ".xls" format with other program like openoffice?
>>>
>>> Thank you for your help and advice.
>>>
>>> Kenneth
>>>
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list