Displaying 1 result from an estimated 1 matches for "textcmd".
Did you mean:
testcmd
2010 Jan 07
1
question on 'within' and 'parse' commands
...low for arbitrary evaluation of
multi-line commands at runtime.
Of course, I can edit the 'within.data.frame' function as follows, but
isn't there some way to make 'within' more generally like the 'eval'
command?
alternative:
within.data.frame <-
function (data, textCMD, ...)
{
parent <- parent.frame()
e <- evalq(environment(), data, parent)
eval(parse(text=textCMD), e) # used to be eval(substitute(expr), e)
l <- as.list(e)
l <- l[!sapply(l, is.null)]
nD <- length(del <- setdiff(names(data), (nl <- names(l))))
dat...