klmr / box

Write reusable, composable and modular R code
https://klmr.me/box/
MIT License
829 stars 47 forks source link

Read environment variables only at startup #344

Open klmr opened 8 months ago

klmr commented 8 months ago

Currently every module import will read several environment variables. This is wasteful, and probably also not intended by the user (particularly for R_BOX_PATH).

The behaviour should be changed to only read these environment variables once at package load time, and setting variables/R options.

Note that this will be a breaking change because changing the value of R_BOX_PATH after ‘box’ has been loaded will now be ignored. However, I think this is an acceptable change that should not affect any existing usage.