variable_plot {ezplot}R Documentation

variable_plot

Description

Plots variables (multiple "y" values) broken out as vertical facets.

Usage

variable_plot(
  data,
  x,
  y,
  group = NULL,
  facet_x = NULL,
  palette = ez_col,
  size = 14,
  labels_y = ez_labels,
  geom = "line",
  size_line = 1,
  legend_ncol = NULL,
  ylab = NULL,
  yoy = FALSE,
  switch = "y",
  rescale_y = 1
)

Arguments

data

A data.frame.

x

A named character value. Evaluates to a column.

y

A named character value. Evaluates to a column.

group

A character value. Evaluates to a column.

facet_x

A character value. Evaluates to a column.

palette

Colour function.

size

theme size for use_theme(). Default is 14.

labels_y

label formatting function

geom

Either "line", "col" or "bar". Default is "line"

size_line

width of line for geom_line(). Default is 1.

legend_ncol

Number of columns in legend.

ylab

y label text

yoy

Logical used to indicate whether a YOY grouping should be created. Default is FALSE.

switch

Option to switch location of variable (facet) labels. Default is 'y' (yes) which shows facet strips on left side of panels.

rescale_y

Rescaling factor for y-axis limits

Examples

suppressPackageStartupMessages(library(tsibble))
library(tsibbledata)
variable_plot(ansett, "Week", "Passengers", facet_x = "Class", yoy = TRUE)
variable_plot(pelt, "Year", c("Lynx", "Hare"), "round(Year, -1)")

[Package ezplot version 0.7.13 Index]