这个
data.table
包用这段代码来完成它
replace_dot_alias <- function(e) {
if (is.call(e)) {
if (e[[1L]] == 'bquote') return(e)
if (e[[1L]] == ".") e[[1L]] = quote(list)
for (i in seq_along(e)[-1L]) if (!is.null(e[[i]])) e[[i]] = replace_dot_alias(e[[i]])
}
e
}
发现于
R/data.table.R
(目前在第173行)。所以你找不到
data.table:::.
然后在
[.data.table" <- function (x, i, j,
... 他们可以做这种事
if (!missing(j)) {
jsub = replace_dot_alias(substitute(j))
root = if (is.call(jsub)) as.character(jsub[[1L]])[1L] else ""