Open your R Markdown document from the last task.
Switch to the visual editor by clicking on the button on the top left.
First, scroll through your document and see how it looks different from the source document view.
Take some minutes and explore the visual editor. If you want, you can try to e.g.,
After you inserted an element, switch back to the normal R Studio editor view (click on the compass button again) and see how your original document changed.
First, cite the original paper that published and analysed the penguin data set. The paper is by Gorman et al. (2014).
In the visual editor and
From DOI
and search the DOI 10.1371/journal.pone.0090081
. This should
list the Gorman paper.Before inserting the citation, have a look at the options that the
Insert Citation
window offers.
On the bottom, There is a check box to chose between in-text (without brackets)
or normal (in brackets) citation.
You can leave the rest at the default settings.
Now hit Insert
and see what changed in the document:
See how RStudio automatically created a references.bib
file in your project
(the same location where your *.Rmd
file is located)
Open references.bib
in the editor to see how it looks like
Look at the YAML header and you will find that the reference file was added automatically
Knit the document and check that the citation was added correctly in the text and that the reference is listed at the end of the document
Now try adding the same citation to a different location in your document. Just start
typing @
and then the first letters of the citation. RStudio should suggest you
citations to chose from.
Add a second citation for the palmerpenguins
package.
Open the references.bib
file in RStudio (or any other text editor) and add the
following BibTeX entry in a new line:
@Manual{horst2020,
title = {palmerpenguins: Palmer Archipelago (Antarctica) penguin data},
author = {Allison Marie Horst and Alison Presmanes Hill and Kristen B Gorman},
year = {2020},
note = {R package version 0.1.0},
doi = {10.5281/zenodo.3960218},
url = {https://allisonhorst.github.io/palmerpenguins/},
}
Save the file and close it.
Now go to you R Markdown document, switch to the visual editor and select a location where you want to add the new citation.
@horst2020
in the text. You should see that RStudio starts suggesting
references that match this name. From the list, select the citation of the
palmerpenguins package.Knit the document.
Were citation and reference added correctly to the text?