Skip to contents

Generates a bar plot showing yearly input and output sums.

Usage

plot_by_year_bars(power_data, year_to_plot = 2024, display_mode = "dark")

Arguments

power_data

data frame with timestamp, INPUT, and OUTPUT columns.

year_to_plot

year for which to plot the dataframe.

display_mode

decides whether to plot dark or light.

Value

A ggplot object showing yearly aggregated values.

Examples

# Example using a small sample data frame
power_data <- data.frame(
  timestamp = c(
    as.POSIXct("2000-01-01 01:00:00", tz = "UTC"),
    as.POSIXct("2000-01-02 01:00:00", tz = "UTC"),
    as.POSIXct("2000-02-01 02:00:00", tz = "UTC"),
    as.POSIXct("2000-02-02 02:00:00", tz = "UTC")
  ),
  INPUT = c(1.0, 2.0, 3.0, 4.0),
  OUTPUT = c(4.0, 3.0, 2.0, 1.0)
)
plot_by_year_bars(power_data)