I would like to write an R package. A small part of its functions would be to save data to an xlsx file. But this function will require a big and heavy dependency: library(xlsx) . Therefore, I would like to make this dependency somehow optional and lazy.
What is his best practice?
I think I could just library(xlsx) in the code of the function he needs and handle the possible crashes of this command.
source share