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_net_power(
  df,
  original_df = NULL,
  import_capacity = NULL,
  export_capacity = NULL,
  colors = NULL,
  ...
)

Arguments

df

tibble, with columns datetime, consumption, production. Optional columns: import_capacity and export_capacity for dynamic capacities.

original_df

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

import_capacity

numeric, maximum power to import from the grid. Not used when df contains a column with the same name.

export_capacity

numeric, maximum power to export to the grid (positive). Not used when df contains a column with the same name.

colors

named list with variable names and colors. For example: colors_def <- list( "production" = "orange", "consumption" = "navy", "net" = "purple", "import_capacity" = "brown", "export_capacity" = "brown" )

...

extra arguments to pass to timefully::plot_ts function

Value

dygraphs plot

Examples

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

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