plot_time_variation: Function to plot hourly, weekday, and monthly averages.

View source: R/plot_time_variation.R

plot_time_variationR Documentation

Function to plot hourly, weekday, and monthly averages.

Description

Function to plot hourly, weekday, and monthly averages.

Usage

plot_time_variation(
  df,
  by = NA,
  n_min = 2,
  colours = NA,
  ylim = c(NA, NA),
  legend_name = NA,
  y_label = "Mean"
)

Arguments

df

Input data frame with at least two variables, two of which are named value and date.

by

A grouping variable to separately plot different variables.

n_min

How many observations are needed to create a valid confidence interval? By default, at least two observations are needed to avoid very large bounds that results in bad y-axes scales.

colours

A vector of colours to use for the plotting.

ylim

Limits for y-axes.

legend_name

A string to overwrite the default legend label.

y_label

A string to overwrite the default y-axes labels.

Value

A ggplot2 list object containing four plots.

Author(s)

Stuart K. Grange


skgrange/threadr documentation built on May 11, 2024, 12:16 p.m.