Skip to contents

These functions are useful for calculating salient statistics on the bibliographies used for dissertations or syllabi. They include the following functions/metrics:

Usage

percent_female(
  bib_file = NULL,
  rmd_file = NULL,
  by = c("author", "publication")
)

mean_year(bib_file = NULL, rmd_file = NULL)

mean_pages(bib_file = NULL, rmd_file = NULL)

total_pages(bib_file = NULL, rmd_file = NULL)

Arguments

bib_file

A .bib file for the project. If not given, the functions use the first .bib file in the folder of rmd_file, or else in the working directory.

rmd_file

An .Rmd or .qmd file. If given, only the entries that this file cites are used. If not given and in RStudio or Positron, the file open in the source editor is used. Otherwise all of the entries in bib_file are used.

by

A string in c("author", "publication") which determines if the percentage of female authors is computed across all papers or the percentage represents the proportion of papers written by at least one woman.

Value

Prints a summary statistic (e.g. mean or proportion)

Details

percent_female()

Displays the percentage of authors in a .bib file that a name-based inference classifies as female. See the {gender} package for more details.

mean_year()

Displays the average year of publication of the items in a given .bib file.

mean_pages()

Displays the average number of pages of the items in a given .bib file.

total_pages()

Displays the total number of pages of all items in a given .bib file.

These functions need the {bib2df} package. percent_female() also needs the {gender} package. It sends the first names of the authors to the genderize.io API, which infers a gender from a first name only. Such an inference is often wrong, for example for names that are not common in Europe or North America, and for people who are not women or men. Use the result as an approximate indicator only.