How to export an R citation output into endnote?
Asked Answered
S

1

7

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?

Searcy answered 3/3, 2011 at 22:1 Comment(0)
D
10

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.

Diarrhea answered 3/3, 2011 at 22:29 Comment(1)
Once you have followed Gavin's advices, you might try this BibTeX to Endnote converter, although I have not used it and it seems a bit old.Brettbretz

© 2022 - 2024 — McMap. All rights reserved.