Working with other packages can mean:
importing functionality from installed packages
adding code, modifications to existing packages which are not yours
including code from other packages into your own
Technical, legal, social, philosophical implications
General advice:
Your package uses another installed package to do something:
mypkg
otherpkg
Depends:
otherpkg
necessary for installing mypkg
library(mypkg)
, otherpkg
will be in the search path for the usermypkg
really only makes sense in the context of otherpkg
, e.g. latticeExtra
and lattice
Imports:
otherpkg
necessary for installing mypkg
otherpkg
will be used internally by mypkg
NAMESPACE
Suggests:
otherpkg
NOT necessary for installing mypkg
Enhances:
otherpkg
NOT necessary for installing mypkg
mypkg
adds functionality to otherpkg
mypkg
has extra methods for classes defined in otherpkg
Reference: Writing R Extensions, Section 1.1.3
Reference: Writing R Extensions, Section 1.5
library(mypkg)
or via mypkg::
mypkg:::
Suggestion:
exportPattern("^[^\\.]")
),@export
-tags before releaseimport(otherpkg)
in NAMESPACE corresponds to library(otherpkg)
in linear codeotherpkg::
will work without import
/importFrom
Suggestion:
@ìmport
important packages at start (replace library
)@import
when you get tired of otherpkg::
@import
with @importFrom
Report issues: informatively, politely (minimal replicable example)
Add fixes via forking:
Alt.: if the licence allows, go rogue with your own (forked) version
Play nice: e.g. ggplot2
code of conduct
Ressources:
Legal under open source licence under certain conditions
For legal & ethical reasons: give credit
Software licensing matters in research, same as data protection & citation rules.
Licensing R: not a legal document, but