Le 14/05/2018 à 15:55, Kurt Hornik a écrit :
Serguei Sokol writes:
Hi,
I came across a case where I cannot access a list element by its empty name.
Minimal example can be constructed as
x=list("A", 1)
names(x)=c("a", "")
x[["a"]]
#[1] "A"
x[[""]]
#NULL
> Serguei Sokol writes:
> Hi,
> I came across a case where I cannot access a list element by its empty name.
> Minimal example can be constructed as
> x=list("A", 1)
> names(x)=c("a", "")
> x[["a"]]
> #[1] "A"
> x[[""]]
> #NULL
> x$`a`
> #[1] "A"
>
Hi,
I came across a case where I cannot access a list element by its empty name.
Minimal example can be constructed as
x=list("A", 1)
names(x)=c("a", "")
x[["a"]]
#[1] "A"
x[[""]]
#NULL
x$`a`
#[1] "A"
x$``
# Error: attempt to use zero-length variable nam