1

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

Kate
  • 13
  • 2
  • 4
    I'm voting to close this question as off-topic because it is not about academia. – Compass Dec 19 '16 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. – cbeleites unhappy with SX Dec 19 '16 at 16:59
  • Some questions are a poor fit for any site. In this case, it appears that the R documentation provides insight, http://stat.ethz.ch/R-manual/R-devel/RHOME/library/utils/html/citation.html – Compass Dec 19 '16 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: http://r-pkgs.had.co.nz/description.html#dependencies – John K. Kruschke Dec 19 '16 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 http://academia.stackexchange.com/questions/27921/should-i-cite-all-r-packages-i-used. 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). – cbeleites unhappy with SX Dec 19 '16 at 17:37
  • @JohnK.Kruschke: yes and no. You can lapply (loadedNamespaces(), citation) and then work on with that list of bibEntry objects to produce the kind of bibliography you need. However, I'd count already this first step as rather advanced and as a developer of an "end user package" I'd not rely on that level of R proficiency with typical users. And a 2nd yes: OP can automate the treatment of Dependencies in their CITATION file e.g. by lapply (package_dependencies("myPackage"), citation). – cbeleites unhappy with SX Dec 19 '16 at 18:05
  • @JohnK.Kruschke: (Advanced) users can lapply (loadedNamespaces(), citation), and OP could maybe lapply (packageDependencies ("myPackage"), citation instead of a manually curated list of the "important" dependencies. Maybe because such constructions that ask information from the installed version of the package can be a PITAdifficult in development. – cbeleites unhappy with SX Dec 19 '16 at 18:13
  • Thanks very much for all of the replies! JohnK.Kurschke and @cbeleites understood the question perfectly - it is about 'nested' citing. I have indeed used the "Depends" mechanism and made these packages imports. I think I will follow the suggested answer below by cbeleites and add a reminder message. Thanks again for the guidance! – Kate Dec 20 '16 at 08:46

1 Answers1

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.

cbeleites unhappy with SX
  • 23,007
  • 1
  • 44
  • 91