Citing articles using roxygen2

前端 未结 2 772
花落未央
花落未央 2021-01-03 23:36

As in this question, I would like to include citations to articles in function documentation. I use roxygen2 for all documentation, and it appears that there wa

2条回答
  •  囚心锁ツ
    2021-01-03 23:56

    Nicely summarized by ms609. I would add that the releases of Rdpack in 2018 provided also macros for citation and the ability to produce the bibliography with a single command insertAllCited{}. Vignette Inserting_bibtex_references, linked also by ms609, provides up-to-date information.

    Rdpack::viewRd() can be used to view the rendered citations without building the package, something like:

    Rdpack::viewRd("./man/filename.Rd")  # text
    Rdpack::viewRd("./man/filename.Rd", type = "html") # html
    

    This may be particularly useful for roxygen2 users since roxygen2 processes the Rd files but doesn't render the references. Just don't forget to update the documentation using devtools::document() or another suitable command before invoking Rdpack::viewRd().

提交回复
热议问题