hist_bool_line: Plot outlines of histogram for a logical variable

View source: R/plot.R

hist_bool_lineR Documentation

Plot outlines of histogram for a logical variable

Description

Kind of like 'hist_bool', but instead of plotting TRUE, FALSE, and NA in 3 separate facets, it plots them as an outline overlaid on a translucent histogram for all values. This is useful when facetting with another categorical variable, such as programming language.

Usage

hist_bool_line(
  pubs,
  col_use,
  facet_by = NULL,
  ncol = 3,
  n_top = Inf,
  binwidth = 365,
  preprints = TRUE
)

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.

facet_by

Name of a column for facetting.

ncol

Number of columns in facetted plot.

n_top

Number of categories with the most publications to plot in facets; the other categories are lumped into "other".

binwidth

Width of bins for the histogram in days.

preprints

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


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