cas_show_gg_base: Creates base ggplot2 object to be used by ggplot or ggiraph

View source: R/cas_show_barchart.R

cas_show_gg_baseR Documentation

Creates base ggplot2 object to be used by ggplot or ggiraph

Description

Creates base ggplot2 object to be used by ggplot or ggiraph

Usage

cas_show_gg_base(
  count_df,
  group_by = date,
  n_column_name = n,
  pattern_column_name = pattern,
  group_as_factor = FALSE,
  font_base_size = 14
)

Arguments

group_by

Defaults to NULL. If given, the unquoted name of the column to be used for grouping (e.g. date, or doc_id, or source, etc.)

n_column_name

Defaults to 'n'. The unquoted name of the column to be used for the count in the output.

pattern_column_name

Defaults to 'pattern'. The unquoted name of the column to be used for the word in the output.

group_as_factor

Defaults to FALSE. If TRUE, the grouping column is forced into a factor, otherwise it is kept in its current format (e.g. date, or numeric).

Value

A ggplot2 object with aesthetics set, but no geometry.

Examples

cas_count(
  corpus = tifkremlinen::kremlin_en,
  pattern = c("putin", "medvedev")
) |>
  cas_summarise(period = "year") |>
  cas_show_gg_base() |>
  cas_show_barchart_ggplot2(position = "dodge")

giocomai/castarter documentation built on Oct. 17, 2024, 7:25 a.m.