character set problem

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

character set problem

bretschr
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

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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 | Threaded
Open this post in threaded view
|

Re: [R-SIG-Mac] character set problem

Kevin Ushey
If I understand correctly, the problem is that the character your keyboard
is inserting is not a regular caret (^, \u0053); rather, it's a 'modifier
character circumflex accent' (ˆ, \u02c6).

How are you inserting the carat on your laptop? For what it's worth, I get
a 'regular' caret with Shift + 6, and that particular accent character with
Alt + I.

On Tue, Feb 19, 2019 at 10:40 AM bretschr <[hidden email]> wrote:

> 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
>
> _______________________________________________
> R-SIG-Mac mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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 | Threaded
Open this post in threaded view
|

Re: character set problem

Bert Gunter-2
In reply to this post by bretschr
You might try posting this on r-sig-mac if you don't get resolution here.

-- Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Feb 19, 2019 at 10:55 AM bretschr <[hidden email]> wrote:

> 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
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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 | Threaded
Open this post in threaded view
|

Re: character set problem

Bert Gunter-2
Oops, you already seem to have done this! My bad.

-- Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Feb 19, 2019 at 11:36 AM Bert Gunter <[hidden email]> wrote:

> You might try posting this on r-sig-mac if you don't get resolution here.
>
> -- Bert
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Tue, Feb 19, 2019 at 10:55 AM bretschr <[hidden email]> wrote:
>
>> 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
>>
>> ______________________________________________
>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> 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.
>>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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 | Threaded
Open this post in threaded view
|

Re: [R-SIG-Mac] character set problem

bretschr
In reply to this post by Kevin Ushey
Dear Kevin Ushey,

Re:

> On 19 Feb 2019, at 20:16, Kevin Ushey <[hidden email]> wrote:
>
> If I understand correctly, the problem is that the character your keyboard is inserting is not a regular caret (^, \u0053); rather, it's a 'modifier character circumflex accent' (ˆ, \u02c6).
>
> How are you inserting the carat on your laptop? For what it's worth, I get a 'regular' caret with Shift + 6, and that particular accent character with Alt + I.


Thanks.  Indeed I just type the normal shift-6, and get this strange circumflex character. With alt-i I get this same character.

I can produce a normal caret by typing

rawToChar(as.raw(94))

in the console, but that's of course rather clumsy.

How to "tame" the editor to produce the normal ASCII caret?
The other symbols in that row, like % and &, are the normal ASCII characters.
Strange why this single character on my keyboard is a two-byte character.

Any clue appreciated.


Franklin




Franklin Bretschneider
Utrecht University
Utrecht, The Netherlands

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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 | Threaded
Open this post in threaded view
|

Re: [R-SIG-Mac] character set problem

bretschr
Dear Peter Anthoni,


Re:

> On 20 Feb 2019, at 07:22, Peter Anthoni <[hidden email]> wrote:
>
> is your keyboard type US. International -PC, that will insert the weird caret.
>
> <bfmoeahenojamlch.png>
>
> cheers
>
> Peter



That 's it!!!  What I thought to be the most universal keyboard proved to be the culprit.
Changed to simple "US" (SystemPreferences, Language and region, Keyboard preferences) and all is OK.
Thanks a lot.
With best regards,

Franklin
- - - - -


Franklin Bretschneider
Utrecht University
Utrecht, The Netherlands
______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.