Description Usage Arguments Details References See Also Examples
Creates backpiping operators
1 |
pipe |
character; string representing the existing pipe operator |
backpipe |
character; string representing the desired backpipe operator |
Only pipe
is necessary. Arbitrary mixing of forward and reverse are
not allowed.
https://github.com/smbache/magrittr/issues/26
http://stackoverflow.com/questions/31305342/is-right-to-left-operator-associativity-in-r-possible
1 2 3 |
function (lhs, rhs)
{
lhs <- substitute(lhs)
rhs <- substitute(rhs)
parent = parent.frame()
ca <- if (is.call(lhs) && deparse(lhs[[1]]) == backpipe) {
rhs. <- call(pipe, rhs, lhs[[length(lhs)]])
lhs. <- lhs[[2]]
call(backpipe, lhs[[2]], rhs.)
}
else {
call(pipe, rhs, lhs)
}
eval(ca, parent, parent)
}
<environment: 0x250b698>
function (lhs, rhs)
{
lhs <- substitute(lhs)
rhs <- substitute(rhs)
parent = parent.frame()
ca <- if (is.call(lhs) && deparse(lhs[[1]]) == backpipe) {
rhs. <- call(pipe, rhs, lhs[[length(lhs)]])
lhs. <- lhs[[2]]
call(backpipe, lhs[[2]], rhs.)
}
else {
call(pipe, rhs, lhs)
}
eval(ca, parent, parent)
}
<environment: 0x250dd00>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.