odd behavior of names

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

odd behavior of names

Gabor Grothendieck
The first component name has backticks around it and the second does
not. Though not wrong, it seems inconsistent.

list(a = 1, b = 2)
## $`a`
## [1] 1
##
## $b
## [1] 2

R.version.string
## [1] "R version 3.5.1 Patched (2018-07-02 r74950)"



--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: odd behavior of names

David Winsemius

> On Jul 29, 2018, at 6:31 AM, Gabor Grothendieck <[hidden email]> wrote:
>
> The first component name has backticks around it and the second does
> not. Though not wrong, it seems inconsistent.
>
> list(a = 1, b = 2)
> ## $`a`
> ## [1] 1
> ##
> ## $b
> ## [1] 2
>
> R.version.string
> ## [1] "R version 3.5.1 Patched (2018-07-02 r74950)"

Agree it would be unexpected. Unable to reproduce on Mac:

list(a = 1, b = 2)
#------
$a
[1] 1

$b
[1] 2

 R.version.string
#[1] "R version 3.5.1 (2018-07-02)"
Platform: x86_64-apple-darwin15.6.0 (64-bit)


>
>
>
> --
> Statistics & Software Consulting
> GKX Group, GKX Associates Inc.
> tel: 1-877-GKX-GROUP
> email: ggrothendieck at gmail.com
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: odd behavior of names

R devel mailing list
Bugzilla issue 16101 describes another first-list-name-printed-differently
oddity
with the Windows GUI version of R:

> a <- "One is \u043E\u0434\u0438\u043D\nTwo is \u0434\u0432\u0430\n"
> Encoding(a) # expect "UTF-8"
[1] "UTF-8"
> sapply(strsplit(a, "\n")[[1]], charToRaw)[c(1,1,2)]
$`One is один`
 [1] 4f 6e 65 20 69 73 20 d0 be d0 b4 d0
[13] b8 d0 bd

$`One is <U+043E><U+0434><U+0438><U+043D>`
 [1] 4f 6e 65 20 69 73 20 d0 be d0 b4 d0
[13] b8 d0 bd

$`Two is <U+0434><U+0432><U+0430>`
 [1] 54 77 6f 20 69 73 20 d0 b4 d0 b2 d0
[13] b0

> names(.Last.value)
[1] "One is один" "One is один"
[3] "Two is два"





Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Sun, Jul 29, 2018 at 8:45 AM, David Winsemius <[hidden email]>
wrote:

>
> > On Jul 29, 2018, at 6:31 AM, Gabor Grothendieck <[hidden email]>
> wrote:
> >
> > The first component name has backticks around it and the second does
> > not. Though not wrong, it seems inconsistent.
> >
> > list(a = 1, b = 2)
> > ## $`a`
> > ## [1] 1
> > ##
> > ## $b
> > ## [1] 2
> >
> > R.version.string
> > ## [1] "R version 3.5.1 Patched (2018-07-02 r74950)"
>
> Agree it would be unexpected. Unable to reproduce on Mac:
>
> list(a = 1, b = 2)
> #------
> $a
> [1] 1
>
> $b
> [1] 2
>
>  R.version.string
> #[1] "R version 3.5.1 (2018-07-02)"
> Platform: x86_64-apple-darwin15.6.0 (64-bit)
>
>
> >
> >
> >
> > --
> > Statistics & Software Consulting
> > GKX Group, GKX Associates Inc.
> > tel: 1-877-GKX-GROUP
> > email: ggrothendieck at gmail.com
> >
> > ______________________________________________
> > [hidden email] mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
>
> David Winsemius
> Alameda, CA, USA
>
> 'Any technology distinguishable from magic is insufficiently advanced.'
>  -Gehm's Corollary to Clarke's Third Law
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: odd behavior of names

Martin Maechler
>>>>> William Dunlap via R-devel
>>>>>     on Sun, 29 Jul 2018 10:06:40 -0700 writes:

    > Bugzilla issue 16101 describes another
    > first-list-name-printed-differently oddity with
    > the Windows GUI version of R:
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Indeed:
        1) "first-list-name-printed" [i.e "names" only in that
                context of printing]
        2) Windows GUI version of R only
           (not 'Rterm', i.e., not in ESS (emacs speaks
           statistics), nor in Rstudio on Windows

Kevin Ushey has reported this last week in an official (and
perfect) bug report to R's bugzilla bug reporting site:

 https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17447

            Bug ID: 17447
           Summary: list() prints first variable name in backticks
           ....
         Component: Windows GUI / Window specific
          Reporter: kevinushey ..  gmail ..

His minimal REPREX was even much simpler:

   > list(a = 1, b = 2)
    $`a`
    [1] 1

    $b
    [1] 2


Thank you, Bill, for the nice extra example.

Martin Maechler
ETH Zurich and R Core Team



> > a <- "One is \u043E\u0434\u0438\u043D\nTwo is \u0434\u0432\u0430\n"
> > Encoding(a) # expect "UTF-8"
> [1] "UTF-8"
> > sapply(strsplit(a, "\n")[[1]], charToRaw)[c(1,1,2)]
> $`One is один`
>  [1] 4f 6e 65 20 69 73 20 d0 be d0 b4 d0
> [13] b8 d0 bd
>
> $`One is <U+043E><U+0434><U+0438><U+043D>`
>  [1] 4f 6e 65 20 69 73 20 d0 be d0 b4 d0
> [13] b8 d0 bd
>
> $`Two is <U+0434><U+0432><U+0430>`
>  [1] 54 77 6f 20 69 73 20 d0 b4 d0 b2 d0
> [13] b0
>
> > names(.Last.value)
> [1] "One is один" "One is один"
> [3] "Two is два"
>
>
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com

[..............................]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel