22

Recently I updated R to 3.5.1 on may Windows 10 with RStudio v1.1.453. I am interested why the first element of a printed list is now always enclosed in backticks? Even if it is a standard name without illegal symbols, e.g., `a` as in this example:

# R 3.5.1
list(a = 1, b = 2, g = 9)
#> $`a`
#> [1] 1
#> 
#> $b
#> [1] 2
#> 
#> $g
#> [1] 9

In previous versions of R, the result looked like this:

# R 3.4.4
list(a = 1, b = 2, g = 9)
#> $a
#> [1] 1
#> 
#> $b
#> [1] 2
#> 
#> $g
#> [1] 9

Do these additional backticks have some meaning? Is it some kind of advancement? Or is it a side effect of some other R functionality? A drawback?

GegznaV
  • 4,938
  • 4
  • 23
  • 43
  • I tried on a R console and Rstudio (1.1453) on (R version 3.5.1 (2018-07-02) Platform: x86_64-apple-darwin15.6.0 (64-bit) )but couldn't reproduce the behavior, probably a windows issue `dput(list(a = 1, b = 2, g = 9)) list(a = 1, b = 2, g = 9)` – akrun Jul 14 '18 at 21:29
  • @akrun, can you reproduce [this one](https://stackoverflow.com/q/51343335/4783029)? – GegznaV Jul 14 '18 at 21:31
  • 4
    Seems like the same issue as https://stackoverflow.com/questions/50387825/unnecessary-backticks-in-r, although there's no real answer there – IceCreamToucan Jul 14 '18 at 21:33
  • Possible duplicate of [Unnecessary backticks in R](https://stackoverflow.com/questions/50387825/unnecessary-backticks-in-r) – Josh Lee Aug 21 '18 at 23:37

2 Answers2

14

This is a bug in R 3.5.1 only on Windows. It has been fixed in r-devel as of 17 August 2018.

Thomas
  • 43,637
  • 12
  • 109
  • 140
  • 1
    When is the fixed version of **R** going to be released? Will it be a patch v3.5.2 which will be released in a few months or is it going to be v3.6.0 and will be released the next year only? – GegznaV Aug 22 '18 at 07:53
  • Probably 3.5.2, I would guess. – Thomas Aug 22 '18 at 13:28
0

I've encountered the same problem here and have used the workaround:

foo = list('asdf'=NA) # Dummy initial entry
for (listname in c('a','b','c')){
  foo[[listname]] = 1
}
njp
  • 620
  • 1
  • 3
  • 16