line_graph: Produce a line graph of a variable.

View source: R/line_graph.R

line_graphR Documentation

Produce a line graph of a variable.

Description

This function takes in data and produces a line graph of "yvar" along the "xvar" axis, categorized by "catvar" and facetted by "facet_label" if specified.

Usage

line_graph(
  dat,
  colors = NULL,
  size = 0.5,
  facet = F,
  label_names = NULL,
  limits = NULL,
  y_type = scales::percent_format(accuracy = 1),
  line_type = NULL,
  title = NULL,
  y_title = NULL,
  caption = NULL
)

Arguments

dat

Data with a columns containing variable of interest ("yvar"), x-axis variable ("xvar"), and grouping variable ("catvar").

colors

Colors for "catvar." NULL (default) returns R's automatic coloring.

size

Line width. Defaults to 0.5.

facet

T to use "facet_label" column to create facetting panels. F (default) does not need "facet_label" column.

label_names

Vector of label names to display for each facet.

limits

Y-axis limits. NULL (default) returns R's automatic limits.

y_type

Data format of "yvar". Default returns percent to nearest unit value.

line_type

Line types for "catvar." NULL (default) returns R's automatic solid lines.

title

Plot title. NULL (default) returns no title.

y_title

Title to display along y-axis. NULL (default) returns no title.

caption

Caption for figure. NULL (default) returns no caption.

Value

Line graph of "yvar" over "xvar", categorized by "catvar" and facetted by "facet_label" if specified., formatted per lab style.


Changing-Cities-Research-Lab/bayViz documentation built on Dec. 5, 2023, 12:06 p.m.