Re: [R] Degree symbol

From: Duncan Murdoch <murdoch.duncan_at_gmail.com>
Date: Tue, 29 Mar 2011 14:48:33 -0400

On 29/03/2011 2:40 PM, stephen's mailinglist account wrote:
> I have been using both Windows and Linux versions of R so when I have
> opened files created in Windows I have found some issues in Linux. One
> was that my windows setup allowed me to enter a degree symbol from the
> keyboard for labelling axes.
> Now I have found that the following expression seems to work on both systems
>
> xlab = expression(paste("Temperature [",degree,"C]")),
>
> (I found this on someone's blog, but I forget who-- thank you whoever you are).
>
> Now my question is can I set up my Linux (ubuntu) system to recognise
> the degree symbol input from the keyboard, or for the sake of
> portability should I just go with the solution I have found?

The issue may be that your Linux system is using UTF-8 encodings, while your Windows one is using the Windows version of Latin1. So if you tell R that your file is encoded in Latin1, it will likely work. You can do this in the DESCRIPTION file for a package, or the "encoding" argument to source().

You can probably tell Ubuntu to use Latin1 for everything, but I would guess that's a bad idea.

Duncan Murdoch



R-help_at_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. Received on Tue 29 Mar 2011 - 18:50:42 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 29 Mar 2011 - 19:20:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive