[R] Using unicode character for 'middle dot' in options(OutDec)

Stephen Eglen S.J.Eglen at damtp.cam.ac.uk
Thu Mar 19 14:31:57 CET 2009


When drawing a graph, I'd like the unicode character 'middle dot'
(or something else similar to \cdot in latex) to be used when writing
numbers.  Something like the following works for me:

x <- 1:10
y <- runif(length(x))

par(las=1, bty='n')
plot(x,y, ylim=c(0,1), yaxt='n')
p <- pretty(y)
axis(2, at=p, labels=format(p, decimal.mark="\u00B7"))

at least on x11() and pdf() devices.  Is it intentional that I can't use
a unicode char though for options(OutDec)?

> options(OutDec='\u00B7')
Error in options(OutDec = "*") : invalid value for 'OutDec'

[I've replaced the cdot with the * in the error line above, in case it mangles
the email into non-ascii.]

R version 2.8.1 (2008-12-22)

Thanks, Stephen




More information about the R-help mailing list