This is a fairly simply question. But I couldn\'t find the answer per google/stackexchange and looking at the documentation of magrittr. How do you feed the result of a chain of
You can also use the <<- operator:
data.frame( x = c(1:3), y = (4:6)) %>%
sum() %>%
`<<-`(a,.)
Edit: I think John Paul's is the safest suggestion, and you could keep going with the chain doing different assignments of partial results. For example:
data.frame( x = c(1:3), y = (4:6)) %>%
sum %>%
assign(x="a",value=., pos=1) %>%
exp %>%
assign(x="b",value=., pos=1) %>%
sqrt %>%
assign(x="c", value=., pos=1)
This will correctly create a, b and c.