plot_series: Plot time series of yearly topic proportions as bars

plot_seriesR Documentation

Plot time series of yearly topic proportions as bars

Description

Plot time series of topics as bars (faceted for multiple topics).

Usage

plot_series(
  series,
  group = "topic",
  date = "pubdate",
  weight = "weight",
  labels = unique(series[[group]])
)

Arguments

series

three-column data frame, as from topic_series

group

name of column in series corresponding to individual series (e.g., "topic")

date

name of column in series corresponding to dates/times

weight

name of column in series corresponding to weights

labels

character vector to label groups by (values of series[[group]] are used by default)

Details

This is a convenience function for quickly visualizing output from topic_series. It does not offer fine-grained control over the plot: for that, I recommend making plots yourself from the data frame.

Value

A ggplot object.

See Also

topic_series to generate the series

Examples

## Not run: 
# slightly more informative labels on a faceted plot
topic_series(m) %>%
     plot_series(labels=topic_labels(m, 4))

# only two topics
topic_series(m) %>%
     filter(topic %in% c(5, 10)) %>%
     plot_series()

## End(Not run)


agoldst/dfrtopics documentation built on July 15, 2022, 4:13 p.m.