Skip to content

reading .odf spreadsheet into R

7 messages · stephen sefick, Sarah Goslee, Erich Neuwirth +4 more

#
I have searched the archives and I did not find the answer to my
question.  Is there a way to read in a .odf spreadsheet without
modification to a .csv file.  I am analyzing my classes scores on
their first exam, and would like to read the grade book in without
converting it to .csv.
thanks
#
I don't know of an elegant solution - I store most of my data as
csv files so it can be easily accessed by all sorts of software
tools - but for small tasks you can can just copy it and then use
read.table("clipboard")

Sarah
On Mon, Feb 2, 2009 at 10:34 PM, stephen sefick <ssefick at gmail.com> wrote:

  
    
#
Using unoconv (http://dag.wieers.com/rpm/packages/unoconv/)
might be a solution.
stephen sefick wrote:

  
    
#
I have not used it, but if you are at all comfortable with Perl, you
might want to look at the Spreadsheet::Read module:

  http://search.cpan.org/~HMBRAND/Spreadsheet-Read/Read.pm

There is a wiki article here:

http://howto.wikia.com/wiki/Howto_read_OpenOffice_OpenDocument_spreadsheets_in_Perl

that provides an overview of Perl options to read ODS files.

HTH,

Marc Schwartz
on 02/03/2009 08:18 AM Erich Neuwirth wrote:
#
If you do look at that you might be able to modify read.xls in gdata
package.  It uses perl code to read xls files so you would already
have the infrastructure R code all set out for you.

On Tue, Feb 3, 2009 at 10:09 AM, Marc Schwartz
<marc_schwartz at comcast.net> wrote:
#
stephen sefick <ssefick <at> gmail.com> writes:
For very simple cases, i.e. only numbers and headers, it is possible to extract
content.xml from the odf (rename it to .zip to see it), and read the required
items with package XML. This is very fast and works well for large, but strictly
structured data.

Dieter
#
Dieter Menne wrote:
Indeed.  I just put a package ROpenOffice up at

   http://www.omegahat.org/ROpenOffice

which provides a read.ods() function and can read worksheets
in a workbook, even those that are not rectangular.
This uses the Rcompression package to read the .ods archive.

I'll eventually coordinate it with the same facilities we have
in the RExcelXML and ROOXML packages which do this
and a few other things for xlsx files for Excel.

  D.