I suspect there is a setlocale(LC_ALL,'C') somewhere in the main of R, but not in the shared library which rpy loads.
Laurent 2008/11/13 Barry Rowlingson <[EMAIL PROTECTED]>: > 2008/11/13 Aurelie Bornot <[EMAIL PROTECTED]>: >> Ok >> So I tried the same chart in python/rpy and in R. >> >> Here are the lines I type in python/rpy : >> m = pylab.load("test.data") >> m >> array([[ 1., 2.], >> [ 2., 3.], >> [ 3., 4.], >> [ 4., 5.], >> [ 5., 6.], >> [ 6., 7.], >> [ 7., 8.], >> [ 8., 9.], >> [ 9., 10.]]) >> r.postscript("TEST_Rpy.ps") >> r.plot(m[:,0],m[:,1]) >> r.dev_off() >> {'null device': 1} >> >> And here are the lines I type in R: >> m=read.table("test.data") >> m >> V1 V2 >> 1 1 2 >> 2 2 3 >> 3 3 4 >> 4 4 5 >> 5 5 6 >> 6 6 7 >> 7 7 8 >> 8 8 9 >> 9 9 10 >> postscript("TEST_R.ps") >> plot(m[,1],m[,2]) >> dev.off() >> null device >> 1 >> >> I join the file test.data and the 2 postscript outputs. >> The 2 postscripts are of the same size but I can't open TEST_Rpy.ps. >> TEST_R.ps is ok for me : I can open it without problem. >> >> Can you see another difference between the two? > > Yes! Commas! > > Running 'diff' on them gives lots of these: > > < 59.76 502.43 (10) .5 0 90 t > --- >> 59,76 107,25 (2) .5 0 90 t > > I didn't notice it at first, but numbers are comma separated in the > python version. This must be a locale-specific way of showing decimal > numbers that's only set in Python... > > PostScript is expecting those numbers to have decimal points (they > are coordinates on the page), and not commas, and hence it gets > confused. I reckon in theory you could make R do this without > involving Python, so it could be an R bug. I wouldn't report it as an > R bug until you can do that though. > > Weird! > > Barry > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > rpy-list mailing list > rpy-list@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rpy-list > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list