annotation_table: Create a data frame for putting labels on a graph.

View source: R/annotation_table.R

annotation_tableR Documentation

Create a data frame for putting labels on a graph.

Description

Create a data frame for putting labels on a graph.

Usage

annotation_table(.x, .col, .focal_value, .group_col)

Arguments

.x

<obj> the data frame to summarize

.col

<str> the name of the column to find indices in.

.focal_value

<num> a value to focus on (e.g. the year 2020)

.group_col

<str> the name of the variable to find indices within

Value

a data frame with fields “Name“, “Measure“, “Value“, and “Label“

Examples

racine_laus |>
    purrr::pluck("wisconsin") |>
    dplyr::mutate(Parsed = list(laus_parse_series(.data$Series))) |>
    tidyr::unnest("Parsed") |>
    dplyr::select("measure_code", "Year", "Month", "Value") |>
    dplyr::filter(.data$Month == "January") |>
    annotation_table("Year", 2020, "measure_code")

higherX4Racine/hiRx documentation built on Nov. 18, 2024, 10:20 a.m.