[R] Excel

Gabor Grothendieck ggrothendieck at gmail.com
Thu Sep 6 20:29:09 CEST 2007


That is not what happens in Excel 2007 when I tried it just now. I tried
saving the same file I displayed in my prior message as an .xls file and
as an .xlsx file and in both cases the first column came back as text,
as I had specified to the Wizard on the initial import.  I guess they fixed
the behavior in Excel 2007.

On 9/6/07, J.delasHeras at ed.ac.uk <J.delasHeras at ed.ac.uk> wrote:
>
> Yes, and then you save it, you open it again... same behaviour.
> The only way I found around it was to insert a character at the
> beginning of every element in such columns. An apostrophe works, but
> it looks ugly. Yes, when loading the data in R you could easily clean
> it up automatically... doable.
> You can add a space. Then it will not show, but you have to remember
> that if you ever use the data for labels etc. You shouldn't need to do
> that in the first place...
>
> Jose
>
> Quoting Erich Neuwirth <erich.neuwirth at univie.ac.at>:
>
> > There is a hack to get around the problem.
> > It is definitely not a good solution, just a hack.
> >
> > Open the .csv file in a text editor and select everything.
> > Paste it into an empty Excel sheet.
> > Then use Data -> Text to Columns
> >
> > The third dialog box (at least it is the third one in Excel 2003)
> > allows you to format each column of the data. This is the place where
> > you can switch off the date interpretation of your ID column.
> >
> > AUG1838 probably is not onterpreted as date because Excel dates only
> > start at 1/1/1900.
> >
> >
> > Duncan Murdoch wrote:
> >> On 8/28/2007 3:16 AM, J Dougherty wrote:
> >>> On Monday 27 August 2007 22:21, David Scott wrote:
> >>>> On Tue, 28 Aug 2007, Robert A LaBudde wrote:
> >>>>> If you format the column as "Text", you won't have this problem. By
> >>>>> leaving the cells as "General", you leave it up to Excel to guess at
> >>>>> the correct interpretation.
> >>>> Not true actually. I had converted the column to Text because I saw the
> >>>> interpretation as a date in the .xls file. I saved the .csv file *after*
> >>>> the column had been converted to Text. Looking at the .csv file in a text
> >>>> editor, the entry is correct.
> >>>>
> >>>> I have just rechecked this.
> >>>>
> >>>> On reopening the .csv using Excel, the entry AUG2699 had been interpreted
> >>>> as a date, and was showing as Aug-99. Most bizarre is that the NHI value
> >>>> of AUG1838 has *not* been interpreted as a date.
> >>>>
> >
> > --
> > Erich Neuwirth, University of Vienna
> > Faculty of Computer Science
> > Computer Supported Didactics Working Group
> > Visit our SunSITE at http://sunsite.univie.ac.at
> > Phone: +43-1-4277-39464 Fax: +43-1-4277-39459
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch 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.
> >
> >
>
>
>
> --
> Dr. Jose I. de las Heras                      Email: J.delasHeras at ed.ac.uk
> The Wellcome Trust Centre for Cell Biology    Phone: +44 (0)131 6513374
> Institute for Cell & Molecular Biology        Fax:   +44 (0)131 6507360
> Swann Building, Mayfield Road
> University of Edinburgh
> Edinburgh EH9 3JR
> UK
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>



More information about the R-help mailing list