[R] configure encoding by default

0 views
Skip to first unread message

Угодай n/a

unread,
Jul 15, 2009, 8:22:23 AM7/15/09
to r-h...@r-project.org
I want using russian letters for my diagrams. I do it in this manner

m <- "заголовок"
Encode(m) <- "UTF-8"
plot(1,1,main=m)

But it is not convenient . How to configure R for using UTF-8 for all
string, to work without Encode-function, as

plot(1,1,main="заголовок")

[[alternative HTML version deleted]]

Duncan Murdoch

unread,
Jul 15, 2009, 8:50:10 AM7/15/09
to Угодай n/a, r-h...@r-project.org
On 7/15/2009 8:22 AM, Угодай n/a wrote:
> I want using russian letters for my diagrams. I do it in this manner
>
> m <- "заголовок"

> Encode(m) <- "UTF-8"
> plot(1,1,main=m)
>
> But it is not convenient . How to configure R for using UTF-8 for all
> string, to work without Encode-function, as
>
> plot(1,1,main="заголовок")

You need to set your locale, either at the system level (and R will use
it) or with Sys.setlocale() within a session. The details of how to
specify that you want UTF-8 characters vary by system; I'm not sure it's
possible in Windows, for instance. See the R Installation and
Administration manual chapter on internationalization.

Duncan Murdoch

______________________________________________
R-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply all
Reply to author
Forward
0 new messages