How to export R quote output to endnote?

How can I easily import quotes from R into the endnote obtained, for example,

citation("ggplot2") 

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

+4
source share
1 answer

How automated this may depend on what Endnote can import. It seems that importing BibTeX is currently not possible out of the box and requires some additional 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 the ?bibentry and in particular the style argument and the Details section. See if Endnote can import data in any of these formats? I doubt it, but I have never used Endnote.

If not, we can go along 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 transfer this to a file for transmission to the 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 contents:

 $ 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 can import using third-party tools.

+5
source

Source: https://habr.com/ru/post/1342195/


All Articles