I am writing my own R package which relies heavily on several others (namely 'biomaRt', 'grasp2db'). I feel as those who use my package should also cite these packages because the code I wrote would not be possible without them. Do I add this to the citations function for my package or because 'biomaRt' and 'grasp2db' are listed as an 'Import' is this somehow already covered? Thanks very much for any guidance. Kate
1 Answer
I like the idea of reminding people calling your package's citation to cite also (at least the important) packages you package relies on. (I even remind people of the citation
function in my package's startup message).
However, for the actual implementation I see two viable ways. The less obtrusive and very easy to implement one would be to print a message
Please do not forget citing "biomaRt" and "grasp2db" as well as they really do the work for myPackage.
.
The second possibility would be to call citation ("biomaRt")
and citation ("grasp2db")
as part of your citation
function. However, this may be less trivial than it seems as citation()
is not only about printing the relevant information but it also generates citation objects. Thus, you'd probably want to assemble and return a list of bibEntry
s.
The non-trivial point is that IIRC some bibliography functions ignore all but the first bibEntry
for a package - while others don't and in addition, you'd want to avoid duplicate entries which users would get who automatically collect citation ()
s of all loaded or attached packages.
Also, depending on how many packages your package depends on, the output of your citation ()
may be long and cluttered.
=> I'd probably go with printing a simple reminder.
citation
. She's asking for recommendations of what thecitation
function of her package should output. This is more related (but from the totally different perspective of a developer) to academia.stackexchange.com/questions/27921/…. That is, if I understand the question correctly, she asks how to provide citation information so people don't need to ask questions like the linked ones (and tell people who wouldn't think of even asking what they should do).