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

  • 4
    I'm voting to close this question as off-topic because it is not about academia.
    – Compass
    Dec 19, 2016 at 16:54
  • 2
    @Compass: while I agree that it is not the best fit here, neither do I see on which sx it would fit better (cross validated is about statistics, not about how to cite or how to help people cite correctly; nor is this an R programming or code review question). All in all, I think that "how to make people cite correctly" is OK on academia.sx. Dec 19, 2016 at 16:59
  • Some questions are a poor fit for any site. In this case, it appears that the R documentation provides insight, stat.ethz.ch/R-manual/R-devel/RHOME/library/utils/html/…
    – Compass
    Dec 19, 2016 at 17:10
  • As far as I can tell, the R documentation is about how to record in the package the citation info of the package. But the question here is about "nested" citing, that is, whether or not to cite a package that has been heavily relied upon in the creation of a new package. (Apologies if wrong.) Perhaps the R mechanism for doing this is the "Depends" of the package: r-pkgs.had.co.nz/description.html#dependencies Dec 19, 2016 at 17:27
  • @Compass: OP is well aware of citation. She's asking for recommendations of what the citation 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). Dec 19, 2016 at 17:37

1 Answer 1


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 bibEntrys. 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.

Not the answer you're looking for? Browse other questions tagged .