I'd like to write a R package. A small part of its functionality would be to save data into xlsx file. But this functionality would require a big and heavy dependency: library(xlsx)
. So I'd like to make this dependency somehow optional and lazy-loaded.
What is the Best Practice for it?
I guess I could simply library(xlsx)
in the code of the function that need it, and handle possible failures of this command.