Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77712cc

Browse files
author
Jonathan Chang
committed
Merge pull request #4 from yikelu/master
Environment Capture
2 parents 283b728 + c69f5af commit 77712cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/R/Rpipe.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Rpipe.prefix.default <- function(e1) {
4141
c("Rpipe.", "")
4242
}
4343

44-
Rpipe.eval <- function(e1, expr) {
44+
Rpipe.eval <- function(e1, expr, env) {
4545
if (as.character(expr[1]) == "(") {
4646
do.call(`%|%`, list(e1 = e1, e2 = expr[[2]]))
4747
} else if (as.character(expr[1]) == "%|%") {
@@ -63,12 +63,12 @@ Rpipe.eval <- function(e1, expr) {
6363
stop(paste("Could not find pipe function", expr[1]))
6464
}
6565
do.call(names(func.names)[1],
66-
c(list(e1), as.list(expr[-1])))
66+
c(list(e1), as.list(expr[-1])), env=env)
6767
}
6868
}
6969

7070
`%|%` <- function(e1, e2) {
7171
expr <- substitute(e2)
72-
Rpipe.eval(e1, expr)
72+
Rpipe.eval(e1, expr, env=parent.frame())
7373
}
7474

0 commit comments

Comments
 (0)