Library Session: Example

Author

Brianna Heggeseth

Relevant Files

Download the following (click to download or right-click > Save File):

Put all of the files in one folder. Open the Rmd and the bib files in RStudio (you may need to File > Open File > references.bib within RStudio).

See below for an example of how to cite articles using information in the bib file. Compare the code in Rmd file to the rendered example online.

Example Article Summary

A recent study was the first to quantify the diversity of artists at U.S. art museums (Topaz et al., 2019).

Heggeseth & Jewell (2013) studied mixture models for clustering longitudinal data and offered an alternative solution when trying to cluster by growth pattern.

Together these studies (Heggeseth & Jewell, 2013; Topaz et al., 2019) were really interesting!

Your Turn!

  1. You write a one sentence summary about one of the articles you found.
  2. Go to Google Scholar, search for your article, and Click on Cite (see image below). Click on BibTeX and copy that to your bib file.

  1. In your bib file, locate the label for the reference. Look for @resourcetype{label,… The labels for existing references were heggeseth2013 and heggeseth2019.

  2. Use the syntax in the examples above to cite YOUR article using YOUR label in YOUR one sentence summary.

Summary Sentence:

More Details about Citations

At the top of the Rmd file, you’ll see bibliography: references.bib and csl: apa.csl.

Bibtex

The file name references.bib refers to the Bibtex file that I created to include all relevant “data” about references I used in a piece of writing (the summary above).

Open the file references.bib. Note the general structure of the file. It is made up of a variety of entries. Each entry in the file refers to a single reference and starts with the type of publication after the @ symbol (e.g., @article, @book, @inproceedings) and ends with }.

An entry consists of:

  • type of publication (word after @)
  • citation key (first word after {)
  • number of tags which define characteristics of the reference (e.g. title, author, journal, year, etc.) separated by commas

CSL Files

The file name apa.csl refers to a citation style language file for the APA citation style. There are many citation styles (see Library Guide). All of these styles are different ways of organizing, formatting, and visualizing the data about a reference.

It is incredibly hard to keep track of all of the styles (e.g. where do I put commas vs. periods?!). If you store the data about references in a standard format using a tool such as a Bibtex file or Zotero, then you can use CSL files to do the styling for you.

Try changing apa.csl to nature.csl in the top of the Rmd file and press Render. This will change the citation and bibliography style to the style used in the journal Nature. Notice similarities and differences.

There is an open source repository of many CSL files available at https://github.com/citation-style-language/documentation

More information about citations in RStudio

For more information about doing references and citations in Rmd or Quarto, see link here.

References

Heggeseth, B. C., & Jewell, N. P. (2013). The impact of covariance misspecification in multivariate gaussian mixtures on estimation and inference: An application to longitudinal modeling. Statistics in Medicine, 32(16), 2790–2803.
Topaz, C. M., Klingenberg, B., Turek, D., Heggeseth, B., Harris, P. E., Blackwood, J. C., Chavoya, C. O., Nelson, S., & Murphy, K. M. (2019). Diversity of artists in major US museums. PloS One, 14(3), e0212852.