[R] Hmisc latex function

David Whiting david.whiting at ncl.ac.uk
Wed Oct 12 17:06:57 CEST 2005

Charles Dupont wrote:

> Hmmmm,  It works for me.  Interesting.
> It almost looks like the temp dir is not being created, but thats not 
> possible because R does that.  It might be a Unicode issue with you 
> system shell.  Can you run this statement in R
> sys(paste('cd',dQuote(tempdir()),";",
> "echo Hello BOB > test.test",
> ";","cat test.test"))
> What version of Hmisc are you using?  What local are you using?
> Charles

I've had similar problems latex() which I tracked down to dQuote() that
I think are related to unicode and locales on Ubuntu 5.04. I think the
problem is with Ubuntu (because I get funny little boxes now and then
with various applications), but have not managed to get my head around
unicode sufficiently well to be able to write a sensible post about this
or work out how to fix it. My current way of getting around this in R is
to change the locale:

> Sys.getlocale()
> tempdir()
[1] "/tmp/RtmpWL64Z2"
> dQuote(tempdir())
[1] "Ã¢Â€Âœ/tmp/RtmpWL64Z2Ã¢Â€Â"  [I get funny little boxes here]
> Sys.setlocale("LC_CTYPE", "C")
[1] "C"
> Sys.getlocale()
> dQuote(tempdir())
[1] "\"/tmp/RtmpWL64Z2\"" [No funny boxes this time]
> version
platform i686-pc-linux-gnu
arch     i686
os       linux-gnu
system   i686, linux-gnu
major    2
minor    1.1
year     2005
month    06
day      20
language R

[Hmmm, I need to update my R installation]

David Whiting
School of Clinical Medical Sciences, The Medical School
University of Newcastle upon Tyne, NE2 4HH, UK.

More information about the R-help mailing list