View source: R/decompose_load_data.R
decompose_load_data | R Documentation |
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.
decompose_load_data(load_data, data_directory = tempdir(), verbose = FALSE)
load_data |
A data frame object with "load", "date", "unit", and "country" columns
|
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) |
A list of three data frames with
A data frame of the long-term trend, including columns for country, year, and yearly average hourly demand.
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.
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.
A list with all created plots.
print("Hi")
example_decomposed_data <- decompose_load_data(example_demand_data_filled)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.