[Rd] Nice names in deparse
Suharto Anggono Suharto Anggono
suharto_anggono at yahoo.com
Sat Dec 16 17:09:04 CET 2017
Tags (argument names) in call to 'list' becomes names of the result. It is not necessarily so with call to 'c'. The default method of 'c' has 'recursive' and 'use.names' arguments.
In R devel r73778, with
x <- 0; names(x) <- "recursive" ,
dput(x)
or even
dput(x, control = "all")
gives
c(recursive = 0)
However, actual result of c(recursive = 0) is NULL.
Also with
x <- 0; names(x) <- "recursive" ,
dput(x, control = c("keepNA", "keepInteger", "showAttributes"))
in R devel r73778
gives
structure(c(0), .Names = "recursive")
The 'control' is suggested by an example for output as in R < 3.5.0. However, the output is slightly different from
dput(x)
in R 3.3.2:
structure(0, .Names = "recursive")
Part of NEWS item related with "niceNames" control option:
as.character(list( c (one = 1))) now includes the name, as as.character(list(list(one = 1))) has always done.
Please reconsider.
As
as.numeric(list(c(one = 1)))
gives
1 ,
I expect that
as.character(list(c(one = "1")))
gives
"1" .
It does in R devel r73778.
Why does
as.character(list(c(one = 1)))
give
"c(one = 1)" ?
as.numeric(list(c(one = "1")))
gives
1 .
list(list(one = 1))
is not quite the same.
as.numeric(list(list(one = 1)))
gives
NA .
More information about the R-devel
mailing list