[R] Transferring a dataset from WINXP to Mac - problems with umlauts

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Mar 28 14:52:30 CEST 2012


On 28/03/2012 13:27, David Winsemius wrote:
> On a Mac running with a US locale, when I first type <option>-u (in
> Mail.app that shows a highlighted "naked umlaut) and then type 'u' I get:
>
> ü
> Similarly with opt-u, 'a'
>
> ä

I don't think that was the problem: he very likely has a German keyboard 
in Jena.  Here's my guess.

Your message dropped the contents for me, so pasting a bit from the 
original:

'is it possible to correctly display umlauts in a dataset, which has 
been created under WINXP, on a Mac-system?'

Depends what is meant by 'a dataset'.  If this a a dataframe, I think 
the simplest thing to do would be to export it to csv (write.csv) on the 
Windows box, and then read it on the Mac with

read.csv(..., fileEncoding="cp1252")

(cp1252 being more plausible than latin1, and is a superset).

Or use dump() on the object, and then source(encoding = "cp1252")

It is also possible to save() the object on WinXP, load() on the Mac and 
then convert with iconv(), but that could be tedious if the non-ASCII 
characters are in more than one element.

If this is not the right guess, we need something more explicit ....

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list