[R] character set problem

bretschr bret@chr @end|ng |rom x@4@||@n|
Tue Feb 19 19:39:17 CET 2019


Dear R-users,


Last week I installed R 3.5.2 on a new MacBook Air.

I got error messages for the wrong locale (character set).
And simple math proved not to work:
Upon typing this, I got:
> 2ˆ2
Error: unexpected input in "2À"
> 

The character visible as a caret is apparently coded as something very different.

Then I changed things according to the FAQ, chapter 7, (switching all settings to English),
and executed the recommended line:

defaults write org.R-project.R force.LANG en_US.UTF-8

The error messages disappeared, but the problem remained.

A fresh install of R 3.5.2 also didn't help: 

Here its startup messages, then a line testing the caret:

> R version 3.5.2 (2018-12-20) -- "Eggshell Igloo"
> Copyright (C) 2018 The R Foundation for Statistical Computing
> Platform: x86_64-apple-darwin15.6.0 (64-bit)
> 
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
> 
> Natural language support but running in an English locale
> 
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
> 
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
> 
> [R.app GUI 1.70 (7612) x86_64-apple-darwin15.6.0]
> 
> [History restored from /Users/fb/.Rapp.history]
> 
>> 2ˆ2
> Error: unexpected input in "2À"
>> 



Does anyone know how to get R (R.app) to interpret a caret as a caret?

Thanks in advance,



Franklin Bretschneider
Utrecht University
Utrecht, The Netherlands



More information about the R-help mailing list