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",
  plot = TRUE
)

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.

plot

Should the plot be printed?

Value

A list object containing two objects – the first element contains four individual plots and the second is the four plots combined into a single object.

Author(s)

Stuart K. Grange


skgrange/threadr documentation built on Jan. 10, 2025, 10:06 a.m.