Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export an R citation output into endnote?

Tags:

r

citations

How can I easily import citations from R into endnote obtained by for instance

citation("ggplot2")

Is there a good workflow for this or do I manually have to do it?

like image 777
Misha Avatar asked Mar 03 '11 22:03

Misha


People also ask

How do you cite an R program in EndNote?

All we have to do is add a comma after R Development Core Team in the name field. This tells EndNote that R Core Development Team is a complete last name of an author that has no first name. Hence, EndNote uses what it has (a last name with no first name) in generating its citations.


1 Answers

How automated this can be will depend on what Endnote can import. It seems BibTeX import is not currently possible out of the box, and requires some extra software. See for example: http://www.lib.uts.edu.au/content/faq/how-can-i-import-bibliography-endnote-bibtex-latex-what-about-converting-other-way-endno

Read ?bibentry and in particular the argument style and the Details section. See if Endnote can import data in any of those formats? I doubt it, but I have never used Endnote.

If not, we can go the BibTeX route if you install something that allows you to import BibTeX into Endnote.

> utils:::print.bibentry(citation("ggplot2"), style = "Bibtex")
@Book{,
  author = {Hadley Wickham},
  title = {ggplot2: elegant graphics for data analysis},
  publisher = {Springer New York},
  year = {2009},
  isbn = {978-0-387-98140-6},
  url = {http://had.co.nz/ggplot2/book},
}

To get this out into a file for passing to an import utility, you can use capture.output()

capture.output(utils:::print.bibentry(citation("ggplot2"), style = "Bibtex"),
               file = "endnote_import.bib")

Which gives a file with the following content:

$ cat endnote_import.bib 
@Book{,
  author = {Hadley Wickham},
  title = {ggplot2: elegant graphics for data analysis},
  publisher = {Springer New York},
  year = {2009},
  isbn = {978-0-387-98140-6},
  url = {http://had.co.nz/ggplot2/book},
}

which you should be able to import with third party tools.

like image 111
Gavin Simpson Avatar answered Nov 03 '22 01:11

Gavin Simpson