Skip to contents

HTML interactive plot showing the hourly energy cost. Also, a comparison between the original scenario is done when original_df is not NULL.

Usage

plot_energy_cost(df, original_df = NULL, ...)

Arguments

df

tibble, with columns datetime, consumption, production, price_imported and price_exported. If imbalance = TRUE, then columns demand_baseline, demand_final, price_turn_up and price_turn_down are also required.

original_df

tibble with same columns than df corresponding to the original scenario (e.g. without flexibility).

...

extra arguments to pass to dygraphs::dyOptions function.

Value

dygraphs plot

Examples

df <- dplyr::select(
  energy_profiles,
  datetime,
  production = solar,
  consumption = building,
  price_imported,
  price_exported
)
df <- dplyr::slice_head(df, n = 300)
head(df)
#> # A tibble: 6 × 5
#>   datetime            production consumption price_imported price_exported
#>   <dttm>                   <dbl>       <dbl>          <dbl>          <dbl>
#> 1 2023-01-01 00:00:00          0        2.61       -0.00146          0.025
#> 2 2023-01-01 00:15:00          0        2.42       -0.00146          0.025
#> 3 2023-01-01 00:30:00          0        2.23       -0.00146          0.025
#> 4 2023-01-01 00:45:00          0        2.04       -0.00146          0.025
#> 5 2023-01-01 01:00:00          0        1.85       -0.00152          0.025
#> 6 2023-01-01 01:15:00          0        1.78       -0.00152          0.025

plot_energy_cost(df)
# Build another random building profile building_variation <- rnorm(nrow(df), mean = 0, sd = 1) df2 <- dplyr::mutate(df, consumption = consumption + building_variation) plot_energy_cost(df2, original_df = df)