Hello, I'm seeing an issue with the development version of magrittr which switches to a lazy evaluation approach. It causes this error in your package:
That's because the pipeline is now evaluated as if it were nested, instead of linearly:
add_arcs(
datamaps(states, scope = "USA", default = "lightgray"),
ori.lon,
ori.lat,
des.lon,
des.lat,
strokeColor
)
#> Error in eval(substitute(origin.lon), data) :
#> invalid 'envir' argument of type 'closure'
Because of lazy evaluation, add_arcs() is run first, and datamaps() only when actually used inside add_arcs(). One ways to fix this is to force() the input like this:
We're planning to release magrittr in one month. It'd be great if you could update your package :)
Note that the future native pipe in the next version of R will use this same approach, so by fixing your package for the new magrittr behaviour you'll make it usable with the native pipe as well.
Hello, I'm seeing an issue with the development version of magrittr which switches to a lazy evaluation approach. It causes this error in your package:
That's because the pipeline is now evaluated as if it were nested, instead of linearly:
Because of lazy evaluation,
add_arcs()
is run first, anddatamaps()
only when actually used insideadd_arcs()
. One ways to fix this is toforce()
the input like this:We're planning to release magrittr in one month. It'd be great if you could update your package :)
Note that the future native pipe in the next version of R will use this same approach, so by fixing your package for the new magrittr behaviour you'll make it usable with the native pipe as well.