ronkeizer / vpc

R library to create visual predictive checks (VPC)
Other
36 stars 20 forks source link

Import `%>%` with indirection #68

Closed lionel- closed 3 years ago

lionel- commented 4 years ago

Hello,

I'm working on the next version of magrittr and I see this failure in one of our common reverse dependencies, xpose:

> xpdb_ex_pk %>% 
+ vpc_data(quiet = TRUE) %>% 
+ list_special()
Error in split_chain(match.call(), env = env) : 
  could not find function "split_chain"

They're calling one of your function which uses %>%. The problem is that you've copied %>% in your namespace instead of importing it. As a result, its definition is set in stone until your package is reinstalled. The previous implementation of magrittr used a split_chain() private helper function which no longer exists.

To avoid these issues, the proper way to use a foreign function is to import it with a NAMESPACE directive, this way it is copied in your namespace at load time rather than build time.

We're planning to release magrittr in one month, it would be great if you could update your package with this fix before then :)

bguiastr commented 3 years ago

@ronkeizer I am just seeing this now is there any plan for you to update vpc with this fix?