forestgeo / learn

Links to interesting articles, videos, tutorials, tips, and more
5 stars 8 forks source link

How people should cite your R package? #193

Open maurolepore opened 5 years ago

maurolepore commented 5 years ago

R creates a standard citation via citation(), by parsing data from DESCRIPTION. But sometimes it is best to add a custom CITATION file in inst/

Example: https://github.com/ropensci/rfishbase/blob/master/inst/CITATION


citEntry(
  entry = 'article',
  title = 'rfishbase: exploring, manipulating and visualizing {FishBase} data from R',
  author = c(person("Carl", "Boettiger", role = c("cre", "aut"), email = "cboettig@ropensci.org"),
             person("Duncan", "Temple Lang", role="aut"), 
             person("Peter", "Wainwright", role="aut")),
  month = 'nov',
  year = '2012',
  publisher = 'Wiley-Blackwell',
  journal = 'Journal of Fish Biology',
  url = 'http://dx.doi.org/10.1111/j.1095-8649.2012.03464.x',
  textVersion = 'C. Boettiger, D. T. Lang and P. C. Wainwright. "rfishbase: exploring, manipulating and visualizing FishBase data from R". In: _Journal of Fish Biology_ 81.6 (Nov. 2012), pp.
2030-2039. DOI: 10.1111/j.1095-8649.2012.03464.x'
  )

The output of citation() is now better:

citation("rfishbase")
#> 
#>   C. Boettiger, D. T. Lang and P. C. Wainwright. "rfishbase:
#>   exploring, manipulating and visualizing FishBase data from R".
#>   In: _Journal of Fish Biology_ 81.6 (Nov. 2012), pp. 2030-2039.
#>   DOI: 10.1111/j.1095-8649.2012.03464.x
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Article{,
#>     title = {rfishbase: exploring, manipulating and visualizing {FishBase} data from R},
#>     author = {Carl Boettiger and Duncan {Temple Lang} and Peter Wainwright},
#>     month = {nov},
#>     year = {2012},
#>     publisher = {Wiley-Blackwell},
#>     journal = {Journal of Fish Biology},
#>     url = {http://dx.doi.org/10.1111/j.1095-8649.2012.03464.x},
#>   }

Created on 2019-02-14 by the reprex package (v0.2.1)