[R] Fwd: importing excel-file

John C Frain frainj at gmail.com
Wed Apr 18 23:38:12 CEST 2007


---------- Forwarded message ----------
From: John C Frain <frainj at gmail.com>
Date: 18-Apr-2007 22:35
Subject: Re: [R] importing excel-file
To: Alberto Monteiro <albmont at centroin.com.br>


One additional suggestion would be to use gretl.  Gretl will read
excel files with an option to possibly ignore the first few rows and
columns and then the data can be exported to an R session started from
within Gretl.  This will also work in both Windows and Linux.  I find
it hard to imagine an excel file that can not be read in  Open Office
or Gnumeric or even Excel and then output to a delimited file in a
matter of seconds.  In my previous employment I conducted several
campaigns against the use of excel formats in favour of a delimited
file which can be opened in almost any program.  I think that we wouls
all be better off if this practice was more widespread.

John Frain

On 18/04/07, Alberto Monteiro <albmont at centroin.com.br> wrote:
> John C Frain wrote:
> >
> > To avoid complications, save your file as comma separated and use one
> > of the instructions for reading delimited files.  If you are using a
> > comma as a decimal point you are probably using ; as a separator.  If
> > this is so use read.csv2.  Please see the help files for read.table.
> >
> I think the problem is that we _can't_ alter or write the excel
> file, or it would be unpractical to do it (say, this xls file
> is generated by someone else once a day, and we must use it).
>
> I usually save the excel file to plain text, and then read it - but
> this is not the best solution when the file keeps changing.
>
> Alberto Monteiro
>
>


--
John C Frain
Trinity College Dublin
Dublin 2
Ireland
www.tcd.ie/Economics/staff/frainj/home.html
mailto:frainj at tcd.ie
mailto:frainj at gmail.com


-- 
John C Frain
Trinity College Dublin
Dublin 2
Ireland
www.tcd.ie/Economics/staff/frainj/home.html
mailto:frainj at tcd.ie
mailto:frainj at gmail.com



More information about the R-help mailing list