How to import .ods?

I am trying to import data (.ods file) and I know how to import .csv, .xls, etc., but I keep hiding it all the time. I tried this with the Gnumeric package, but R tells me that the desired program 'ssconvert' cannot be found.

+10
import r ods gnumeric ssconvert
source share
4 answers

I wrote a package called readODS which has a read.ods function that returns data.frames files as data.frames (list of data.frames , one per sheet)

It is available on CRAN, see here !

Source and error messages here: https://github.com/chainsawriot/readODS

+26
source share

I had the exact problem with Ubuntu Linux. This is sadly obvious:

sudo apt-get install gnumeric


Be that as it may, I had a lot of outdated packages, and I went through a bunch to update them. The gnumeric library requires an XML library, and my installation of the XML library was built on 2.14, and my R did not load anything that was built before 3.0. I do not think this is your problem, but if the solution above does not work, perhaps you can also check that your packages are updated. Everything that I installed via sudo needed to be removed using sudo , or I got permission errors.


This is sadly obvious because the error message

Error in read.gnumeric.sheet (file = fname, head = TRUE, sheet.name = "Sheet1"): The required program 'ssconvert' was not found.

To emphasize this, the package documentation at http://cran.at.r-project.org/web/packages/gnumeric/gnumeric.pdf says

An external ssconvert program is required (usually installed with gnumeric ( http://projects.gnome.org/gnumeric/ ) in PATH.

How do you get ssconvert ? Again, it is disappointingly obvious: it is usually installed with gnumeric. Go to the command line and type ssconvert and it will remind you that:

user @ Computer: ~ $ ssconvert
The 'ssconvert' program is not currently installed. You can install it by typing: sudo apt-get install gnumeric

I checked, ssconvert not in the dependency packages (e.g. gnumeric-common ), it is in gnumeric , so you need to install the full gnumeric package:

sudo apt-get install gnumeric

+3
source share

I have not tried it, but the ROpenOffice package looks like it can complete the task: http://www.omegahat.org/ROpenOffice/

0
source share

Short answer: install your tools on Linux, possibly on a virtual machine, and then work with the gnumeric library. Using library(gnumeric) on Linux is as simple as installing gnumeric on your system, and then installing the gnumeric package in the R environment that you are using.

It turns out it's hard to install on Windows or Mac.

Mac OSx

To install the same on Mac OSX, this is a serious problem. You will need to get gnumeric (a spreadsheet application) through macports, which means installing xcode and then macports, fink or homebrew. This is a major operation if you are not in the habit of installing software ported from Linux. I know that I cannot expect that I am writing R code for current users.

Window

You might think that it is easier on Windows, as it is , and it installs ssconvert.exe in the application folder, But setting the PATH variable to find this application ssconver.exe is apparently not enough. The problem "cannot find ssconvert" is replaced by other table reading problems. This, of course, does not behave the same as on Linux.

For ROpenOffice, something similar is the basis for the problems. An Rcompression package is required, but it is not an R package, but a compression technology that should be available at the system level. Installing this on windows / mac doesn't seem easy, so you get similar issues with gnumeric.

This is a real shame, because .ods promises should be a (relatively) pleasant intermediate format to avoid many problems with data in Excel file formats (there are too many of them) or Excel export (Excel is unable to work with text formats such as csv between os , no utf-8, etc.).

0
source share

All Articles