Reputation: 8484
I'm working on a fork of a package that depends upon the ReporteRs library.
However, this library has been deprecated by its owner for a few years, in favour of the officer and flextable libraries.
On of the main reasons for this depreciation is not to depend on rJava
, which may cause installation problems and bugs.
In my package, how should I manage this case?
So far, my package was processing data to return a ReporteRs
object. If I change my functions to return an officer
object I would break backward compatibilty.
But if I don't, and keep old, ReporteRs
returning function as legacy backward compatibilty functions, I have to keep ReporteRs
in my dependencies and my package would be rJava
-dependant.
Is there a win-win solution?
Upvotes: 1
Views: 143
Reputation: 17090
Here is what I would do:
EDIT: As discussed above, you can make your dependency on ReportR
conditional on the availability of ReportR
. Then, you can put ReportR
into the Suggests
field of the DESCRIPTION file rather than Depends, and in the package you can use code like this:
if(requireNamespace("ReportR")) {
warning("This function is deprecated, better use MyNewFunction instead")
ReportR::whatever() ...
} else {
warning("To run this (deprecated) function, please install the ReportR package")
}
Upvotes: 1