I wasn't able to find an answer to this via searching SO/issues, so I'll just ask:
Is this legal way of accessing .SD:
someFun <- function(dt) {
stopifnot(!is.null(dt))
5
}
r <- data.table::data.table(iris)
r[ , someFun(data.table::.SD) # Not OK
, by=.(Sepal.Length)
]
# Error: !is.null(dt) is not TRUE
r[ , someFun(.SD) # OK
, by=.(Sepal.Length)
]
In someFun, the arg dt is NULL. Not a huge pain since I can do an explicit package import, but curious never-the-less.
edit: fixed up example
I wasn't able to find an answer to this via searching SO/issues, so I'll just ask:
Is this legal way of accessing .SD:
In
someFun, the argdtis NULL. Not a huge pain since I can do an explicit package import, but curious never-the-less.edit: fixed up example