nathaneastwood / poorman

A poor man's dependency free grammar of data manipulation
https://nathaneastwood.github.io/poorman/
Other
339 stars 15 forks source link

Question: importing {poorman} namespace for {dplyr}-dependent packages #96

Closed leszek-sieminski-at-brainly closed 2 years ago

leszek-sieminski-at-brainly commented 2 years ago

Hello! Thanks for creating this awesome package!

I'd like to use {poorman} in one of my projects, but some packages I need to use (that help with API connections, i.e. {slackr}) are {dplyr}-dependent.

Is it possible to load {poorman}'s namespace as if it was {dplyr}'s so they can work properly? I imagine something similar to Python's import ... as ... functionality. I even found this thread that may be useful in this case, but maybe there is another way that you know about?

Best, Leszek

nathaneastwood commented 2 years ago

If the package you are using (e.g. slackr) already imports dplyr then unfortunately you'll be a little stuck. You have a couple of options:

  1. Hacky implementation such as the ones you linked
  2. Fork the package(s) and swap dplyr for poorman yourself - probably quite a bit of work

You may want to take a look at https://github.com/klmr/box, whilst it might not help you in this situation, it could be helpful for what you want in the future.