Skip to contents

Get data for plot type to present it next to the plot.

Usage

get_data_for_plot_type(plot_type, power_data)

Arguments

plot_type

name of the selected plot type.

power_data

data frame with timestamp, INPUT, and OUTPUT columns.

Value

A data frame with values matching the plot.

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)
)
get_data_for_plot_type("by hour per month lines", power_data)
#> # A tibble: 4 × 4
#>   month   hour  type         value
#>   <chr>   <chr> <chr>        <dbl>
#> 1 2000-01 01    total_input      3
#> 2 2000-01 01    total_output     7
#> 3 2000-02 02    total_input      7
#> 4 2000-02 02    total_output     3