[R] dot - comma problem

Milan Bouchet-Valat nalimilan at club.fr
Sun May 20 22:33:00 CEST 2012


Le dimanche 20 mai 2012 à 23:52 +1000, may.ka38 at yahoo.de a écrit :
> Dear all
> 
> I am trying to use the ODB package to connect to an libreoffice-odb database. 
> The libreoffice package is german, thus, decimal separator is a comma. However, 
> I can open the database and upload a it without error,
> 
> library(ODB)
> db <- odb.open("Test.odb")
> 
> but a soon as the "odb.open" command is executed, the decimal separator in R 
> is changed to comma.
> 
> Before loading the database:
> 
> > a <- 10.1
> > a
> [1] 10.1
> 
> After loading the database
> 
> > db <- odb.open("Buchhaltung.odb")
> > a
> [1] 10,1
> 
> but assigning a numeric value to a variable still requires a dot:
> 
> > a <- 5,1
> Error: Unexpected ',' in "a <- 5,"
> 
> Futhermore, printed variables still use the comma as decimal separator:
> 
> > write.csv(a)
> "","x"
> "1",10,1
> 
> Since this leads to serious parsing errors when odb sets up sql-queries (eg 
> 5,1 becomes 51), I need to get rid of that behaviour such that numeric values 
> are correctly displayed with a dot as a decimal separator.
> 
> Does anyone has an idea?
I recently experienced this with a totally unrelated package. The
culprit turned out to be RWeka (which depends on rJava, like ODB) when
used with Java 7 (on Fedora Linux 17). Can you simply try loading RJDBC
and print a decimal number? Please also check your Java version, and
give us system information as requested by Brian Ripley.


Regards



More information about the R-help mailing list