它似乎%>%在magrittr包中不起作用load().这是我重现我的问题的最小例子.
## Create two example variables and save to tempdir()
a <- 1
b <- 1
save(list = ls(), file = file.path(tempdir(), 'tmp.RData'))
## Remove all variables and load into global environment
# rm(list = ls())
load(file.path(tempdir(), 'tmp.RData'))
ls()
# [1] "a" "b"
# Write the same code with pipe "%>%", but not variable is loaded
# rm(list =ls())
library(magrittr)
tempdir() %>% file.path('tmp.RData') %>% load
ls()
# character(0)
Run Code Online (Sandbox Code Playgroud)
我不明白为什么管道不起作用load().谢谢你的任何建议.