Hello everyone! I work with a german excell version which uses commas instead of points for seperating decimal places. R work with points so in order to be able to save my excell tables without changing the commas to points, whenever I load a table I type in: read.table(..., dec = ",") only R puts the points into the wron places. For excample excell has a cell with the number: 0,09 so what R does, it writes the number as 0.9 which is wrong and makes my calculations become useless. Does anyone know this problem? Maby I made a mistake somewhere? I would be glad about your answers! Cheers, Anna -- Der Inhalt dieser E-Mail ist vertraulich. Sollte Ihnen die E-Mail irrt?mlich zugesandt worden sein, bitte ich Sie, mich unverz?glich zu benachrichtigen und die E-Mail zu l?schen. This e-mail is confidential. If you have received it in error, please notify me immediately and delete it from your system.
>From ?read.csv:read.csv2( file, header = TRUE, sep = ";", quote="\"", dec=",", fill = TRUE, comment.char="", ...) I think this is specifically set up for German decimal commas. Rgds, Rainer On Thursday 06 October 2011 17:39:46 Anna Lee wrote:> Hello everyone! > > I work with a german excell version which uses commas instead of > points for seperating decimal places. R work with points so in order > to be able to save my excell tables without changing the commas to > points, whenever I load a table I type in: read.table(..., dec = ",") > only R puts the points into the wron places. For excample excell has a > cell with the number: 0,09 so what R does, it writes the number as 0.9 > which is wrong and makes my calculations become useless. > > Does anyone know this problem? Maby I made a mistake somewhere? > > I would be glad about your answers! > > Cheers, Anna > >
On 06.10.2011 17:39, Anna Lee wrote:> Hello everyone! > > I work with a german excell version which uses commas instead of > points for seperating decimal places. R work with points so in order > to be able to save my excell tables without changing the commas to > points, whenever I load a table I type in: read.table(..., dec = ",") > only R puts the points into the wron places. For excample excell has a > cell with the number: 0,09 so what R does, it writes the number as 0.9Please specify an example with the excel output and what R reads. You will find that such an example does not exist and hence you made some mistake and compared different numbers or so. Uwe Ligges> which is wrong and makes my calculations become useless. > > Does anyone know this problem? Maby I made a mistake somewhere? > > I would be glad about your answers! > > Cheers, Anna >
Hi Anna, have a look at ?write.csv2, which deals with the Excel conventions for CSV in German locale. cheers Am 06.10.2011 17:39, schrieb Anna Lee:> Hello everyone! > > I work with a german excell version which uses commas instead of > points for seperating decimal places. R work with points so in order > to be able to save my excell tables without changing the commas to > points, whenever I load a table I type in: read.table(..., dec = ",") > only R puts the points into the wron places. For excample excell has a > cell with the number: 0,09 so what R does, it writes the number as 0.9 > which is wrong and makes my calculations become useless. > > Does anyone know this problem? Maby I made a mistake somewhere? > > I would be glad about your answers! > > Cheers, Anna >-- Eik Vettorazzi Institut f?r Medizinische Biometrie und Epidemiologie Universit?tsklinikum Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790 -- Pflichtangaben gem?? Gesetz ?ber elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universit?tsklinikum Hamburg-Eppendorf; K?rperschaft des ?ffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Guido Sauter (Vertreter des Vorsitzenden), Dr. Alexander Kirstein, Joachim Pr?l?, Prof. Dr. Dr. Uwe Koch-Gromus
Sorry guys, I allready found the solution. Excell showed some of the numbers in the format: 1,90053-E05 and R interpreted it as 1.9... I changed that in Excel Cheers, Anna Am 6. Oktober 2011 17:48 schrieb Uwe Ligges <ligges at statistik.tu-dortmund.de>:> > > On 06.10.2011 17:39, Anna Lee wrote: >> >> Hello everyone! >> >> I work with a german excell version which uses commas instead of >> points for seperating decimal places. R work with points so in order >> to be able to save my excell tables without changing the commas to >> points, whenever I load a table I type in: read.table(..., dec = ",") >> only R puts the points into the wron places. For excample excell has a >> cell with the number: 0,09 so what R does, it writes the number as 0.9 > > Please specify an example with the excel output and what R reads. You will > find that such an example does not exist and hence you made some mistake and > compared different numbers or so. > > Uwe Ligges > > >> which is wrong and makes my calculations become useless. >> >> Does anyone know this problem? Maby I made a mistake somewhere? >> >> I would be glad about your answers! >> >> Cheers, Anna >> >-- Der Inhalt dieser E-Mail ist vertraulich. Sollte Ihnen die E-Mail irrt?mlich zugesandt worden sein, bitte ich Sie, mich unverz?glich zu benachrichtigen und die E-Mail zu l?schen. This e-mail is confidential. If you have received it in error, please notify me immediately and delete it from your system.