decompose_load_data: Decomposing the load data into long-, mid- and short-term...

View source: R/decompose_load_data.R

decompose_load_dataR Documentation

Decomposing the load data into long-, mid- and short-term component

Description

This function decomposes the load data into three components: a yearly long-term trend, a daily mid-term seasonality, and an hourly short-term seasonality. If the data is available only at a daily resolution, the calculation of hourly seasonality is skipped. The results of the decomposition are returned as a list of dataframes. The series are plotted additionally.

Usage

decompose_load_data(load_data, data_directory = tempdir(), verbose = FALSE)

Arguments

load_data

A data frame object with "load", "date", "unit", and "country" columns

load

Consisting of the load values, numeric.

date

Consisting of the datetime values, datetime (e.g. POSIXct).

unit

Indicating the unit, e.g. MW, character.

country

Indicating the country's ISO2C code, character.

data_directory

The path to the directory where the data will be saved. The default is set to a temporary directory.

verbose

A boolean value indicating if you want the generated plots to be shown (set to TRUE if yes)

Value

A list of three data frames with

longterm

A data frame of the long-term trend, including columns for country, year, and yearly average hourly demand.

midterm

A data frame of the mid-term component, including country, date, year, month, day, weekday, average hourly demand, and seasonal average hourly demand. Where seasonal average hourly demand corresponds to the difference between the yearly average demand per hour and the daily average demand per hour of the respective day.

shortterm

A data frame of the short-term component, including country, date, year, month, day, weekday, hour, hourly demand, and hourly demand trend and trend and season corrected. Where hourly demand trend and season corrected corresponds to the difference between the daily average demand per hour and the actual demand in the respective hour, effectively showing the intra-day pattern.

plots

A list with all created plots.

Examples

 print("Hi")
example_decomposed_data <- decompose_load_data(example_demand_data_filled)

oRaklE documentation built on June 8, 2025, 12:41 p.m.