[R] on specifying an encoding for plot's main-argument

Daniel Bastos dbastos at toledo.com
Fri Jan 29 16:35:50 CET 2016


Here's how I plot a graph.

  plot(c(1,2,3), main = "graph ç")

The main-string has a UTF-8 character "ç".  I believe I'm using the
windows device.  It opens up on my screen.  (The window says ``R
Graphics: Device 2 (ACTIVE)''.)  How can I tell it to use my encoding of
choice?

I looked around the web for explanations on how to properly tell the
relevant mecanisms that I'm using strings with a partcular encoding when
plotting.  I saw many with my difficulty, but no one seemed to explain
the whole issue.

At first I thought I should tell the device.  So I looked at the
documentation for various devices.  I realized only devices such as
postscript, pdf had an encoding parameter.  ``My assumptions must be
wrong'', I thought.  ``Perhaps it's not the device I must tell my
encoding.''

Then I come to you.  Can you point me towards understanding the issue?
You can tell me to read an entire book on encoding, charset and fonts.
I'd like to free myself from such difficulties.

I use R and ESS (GNU EMACS).  (My ESS console says 'U' in the EMACS
modeline.  It means I'm encoding in UTF-8.  I tried '1', ISO-8859-1,
also called Latin-1.)

Thank you.

(*) The softwares

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)

ess-version: 15.09-2 [Released git: 01328e83039f]

GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-17 on MARVIN



More information about the R-help mailing list