era_freqpoly: Prequel vs current binned over time

View source: R/plot.R

era_freqpolyR Documentation

Prequel vs current binned over time

Description

Plots freqpoly for prequel vs current, with an option to start both at the date when the first publication in the category appeared. The point here is not to compare to the distribution of everything, like in hist_bool, or to compare when things started, like when I plotted a histogram of different methods over time, but to compare the height of the histograms and how steeply they rise and fall. So I think freqpoly may be better than blocky histograms for this purposes.

Usage

era_freqpoly(
  pubs,
  col_use,
  since_first = FALSE,
  binwidth = 365,
  preprints = TRUE,
  do_smooth = FALSE,
  smooth_method = NULL,
  smooth_formula = NULL
)

Arguments

pubs

A data frame with at least these columns:

journal

Name of the journal of the paper.

year

Year when the paper was published.

There must be one row per publication or per method or species for each title if faceting by those. If facetting, then a column whose name is the value in 'facet_by' must be present.

col_use

Which logical variable to plot. Tidyeval is supported.

since_first

Logical. Whether to plot days after the first publication appeared.

binwidth

Width of bins for the histogram in days.

preprints

Logical, whether preprints should be included. Defaults to 'TRUE' to include preprints.

do_smooth

Logical. Whether to plot smoothed curve for the trend rather than freqpoly.

smooth_method

Method of smoothing, passed to geom_smooth.

smooth_formula

Formula of smoothing, passed to geom_smooth.

Value

A ggplot2 object


pachterlab/museumst documentation built on April 20, 2024, 11:26 p.m.