rt_explore_plot_time_series: returns a time-series plot

View source: R/explore_basics.R

rt_explore_plot_time_seriesR Documentation

returns a time-series plot

Description

returns a time-series plot

Usage

rt_explore_plot_time_series(
  dataset,
  variable,
  comparison_variable = NULL,
  comparison_function = NULL,
  comparison_function_name = NULL,
  color_variable = NULL,
  facet_variable = NULL,
  year_over_year = FALSE,
  y_zoom_min = NULL,
  y_zoom_max = NULL,
  include_zero_y_axis = TRUE,
  show_points = FALSE,
  show_labels = FALSE,
  date_floor = NULL,
  date_break_format = NULL,
  date_breaks_width = NULL,
  date_limits = NULL,
  format_as_percent = FALSE,
  base_size = 11
)

Arguments

dataset

dataframe

variable

a variable (x-axis) that is a date type

comparison_variable

the additional numeric variable (y-axis)

comparison_function

if a comparison variable is supplied, a function must be given so the plot knows how to graph it (e.g. sum, mean, median)

comparison_function_name

name of the function so that it can be plotted on the Y-axis label

color_variable

an optional variable (categoric) that seperates the time series

facet_variable

an optional variable (categoric) that seperates the time series by facet

year_over_year

if true it displays the graph year-over-year; color_variable should be NULL (color will be year)

y_zoom_min

adjust (i.e. zoom in) to the y-axis; sets the minimum y-value for the adjustment

y_zoom_max

adjust (i.e. zoom in) to the y-axis; sets the maximum y-value for the adjustment

include_zero_y_axis

expand the lower bound of the y-axis to 0 (TRUE is best practice.)

show_points

if TRUE adds points to the graph

show_labels

if TRUE adds labels to each point

date_floor

converts dates to date_floor value and aggregates; options are e.g. "week", "month", "quarter"

date_break_format

format of date breaks e.g. ''%Y-%m-%d''

date_breaks_width

the date breaks for x axis, values correspond to ggplot scale_x_date e.g. "1 month", "1 week"

date_limits

"zoom" for date x-axis, 2 values representing min/max in the format of YYYY-MM-DD. If 'date_floor' is used, the date_limits are converted to the corresponding date floor e.g. if date_floor is 'month' and date_limits are ‘c(’2013-01-15', '2013-12-15')‘ they will be converted to 'c(’2013-01-01', '2013-12-01')'

format_as_percent

if 'TRUE' display the y-axis as a percent, as well as any text labels

base_size

uses ggplot's base_size parameter for controling the size of the text


shane-kercheval/rtools documentation built on July 7, 2022, 8:31 a.m.