Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flrd/standardlastprofile
R Data Package for BDEW Standard Load Profiles in Electricity
https://github.com/flrd/standardlastprofile
data electricity germany r
Last synced: 9 days ago
JSON representation
R Data Package for BDEW Standard Load Profiles in Electricity
- Host: GitHub
- URL: https://github.com/flrd/standardlastprofile
- Owner: flrd
- License: cc0-1.0
- Created: 2023-11-10T21:32:53.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-24T08:46:06.000Z (6 months ago)
- Last Synced: 2024-11-28T06:07:30.456Z (about 1 month ago)
- Topics: data, electricity, germany, r
- Language: R
- Homepage: https://flrd.github.io/standardlastprofile/
- Size: 22.3 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "95%",
fig.align = "center"
)
```# standardlastprofile
[![R-CMD-check](https://github.com/flrd/standardlastprofile/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/flrd/standardlastprofile/actions/workflows/R-CMD-check.yaml)
[![](https://codecov.io/gh/flrd/standardlastprofile/branch/main/graph/badge.svg)](https://app.codecov.io/gh/flrd/standardlastprofile)
[![](https://www.r-pkg.org/badges/version/standardlastprofile)](https://cran.r-project.org/package=standardlastprofile)
[![](http://cranlogs.r-pkg.org/badges/grand-total/standardlastprofile)](https://cran.r-project.org/package=standardlastprofile)This package provides data on representative, standard load profiles for electricity from the German Association of Energy and Water Industries (BDEW Bundesverband der Energie- und Wasserwirtschaft e.V.) in a tidy format.
``` {r, message=FALSE, include = FALSE}
library(standardlastprofile)
library(ggplot2)
``````{r small_multiples, echo = FALSE, fig.asp = 1.6, fig.retina=2}
#| fig.alt = "Small multiple line chart of 11 standard load profiles
#| published by the German Association of Energy and Water Industries (BDEW
#| Bundesverband der Energie- und Wasserwirtschaft e.V.). The lines compare
#| the consumption for three different periods over a year, and
#| also compare the consumption between different days of a week."# labeller
label_names <- c(
"saturday" = "Saturday",
"sunday" = "Sunday",
"workday" = "Workday"
)label_fun <- function(x) label_names[[x]]
# reorder facets
tmp <- slp
tmp$day <- factor(slp$day, levels = c("workday", "saturday", "sunday"))# plot
ggplot(tmp,
aes(x = as.POSIXct(x = paste(Sys.Date(), timestamp)),
y = watts,
color = period)) +
geom_line() +
facet_grid(profile_id ~ day,
scales = "free_y",
labeller = labeller(day = as_labeller(label_names))) +
scale_x_datetime(NULL, date_breaks = "6 hours", date_labels = "%k:%M") +
scale_y_continuous(NULL, n.breaks = 3, limits = c(0, NA)) +
scale_color_manual(name = NULL,
values = c(
"winter" = "#961BFA",
"summer" = "#FA9529",
"transition" = "#0CC792"
)) +
labs(title = "Standard Load Profiles",
subtitle = "96 x 1/4h measurements [in watts], based on consumption of 1,000 kWh/a",
caption = "data: www.bdew.de") +
theme_minimal() +
theme(legend.position = "top") +
theme(strip.text.y.right = element_text(angle = 0)) +
theme(
panel.grid.minor.x = element_blank(),
panel.grid.minor.y = element_blank(),
panel.grid = element_line(
linetype = "12",
lineend = "round",
colour = "#FAF6F4")
) +
NULL
```## Installation
You can install standardlastprofile from CRAN with:
```{r eval=FALSE}
install.packages("standardlastprofile")
```To install the development version from [GitHub](https://github.com/) use:
``` {r eval=FALSE}
# install.packages("devtools")
devtools::install_github("flrd/standardlastprofile")
```## Included Features
- `slp` -- A dataset containing BDEW standard load profiles for electricity.
- `slp_generate()` -- An interface for generating a standard load profile for a user-defined time period.
- `slp_info()` -- A function for retrieving details of standard load profiles.## About the Data
The dataset `slp` is the result from an analysis of 1,209 load profiles of low-voltage electricity consumers in Germany, published in 1999.[^bdew-2] It contains a total of 9,504 observations across 5 variables:[^bdew-2]: More information on the data and methodology can be found [here](https://www.bdew.de/media/documents/1999_Repraesentative-VDEW-Lastprofile.pdf).
- `profile_id`: identifier of a standard load profile
- `period`: one of "summer", "winter", "transition"
- `day`: one of "workday", "saturday", "sunday"
- `timestamp`: format "%H:%M"
- `watts`: electric power``` {r, message=FALSE}
library(standardlastprofile)
str(slp)
```In the context of the German electricity market, the term 'Standard Load Profile' denotes a representative pattern of electricity consumption over a specific period. These profiles portray anticipated electricity consumption for diverse customer groups, like households or businesses. While not an exact match for an individual customer's consumption profile, they serve as a valid approximation for larger groups of similar customers.
For each unique combination of `profile_id`, `period` and `day` there are
96 x 1/4 hour measurements in watts. If you have no idea what `H0` means,
you are not alone:- `H0`: households (German: "Haushalte")
- `G0` to `G6`: commerce ("Gewerbe")
- `L0` to `L2`: agriculture ("Landwirtschaft")For more details, call the `slp_info()` function.
``` {r, message=FALSE, echo=TRUE}
slp_info(profile_id = "H0", language = "DE")
```### Generate a Standard Load Profile
To create a standard load profile for a specified time period, call the `slp_generate()` function:
``` {r, G5_data_readme, message=FALSE, echo=TRUE}
G5 <- slp_generate(
profile_id = "G5",
start_date = "2023-12-22",
end_date = "2023-12-27"
)head(G5)
`````` {r G5_plot_readme, message=FALSE, echo=FALSE, fig.retina=2, fig.asp=0.5}
#| fig.alt = "Line plot of the standard load profile 'G5' (i.e. Bakery
#| with a bakehouse) based on data from the German Association of Energy
#| and Water Industries (BDEW Bundesverband der Energie- und Wasserwirtschaft
#| e.V.) from December 22nd to December 27th 2023; values
#| are normalized to an annual consumption of 1,000 kWh."
ggplot(G5, aes(start_time, watts)) +
geom_line(color = "#0CC792") +
scale_x_datetime(
date_breaks = "1 day",
date_labels = "%b %d") +
labs(
title = "'G5': bakery with bakehouse",
subtitle = "1/4h measurements, based on consumption of 1,000 kWh/a",
caption = "data: www.bdew.de",
x = NULL,
y = "[watts]") +
theme_minimal() +
theme(
panel.grid.minor.x = element_blank(),
panel.grid.minor.y = element_blank(),
panel.grid = element_line(
linetype = "12",
lineend = "round",
colour = "#FAF6F4"
)
) +
NULL
```For more information, details about the data, and an explanation of the algorithm,
call [`vignette("algorithm-step-by-step", package = "standardlastprofile")`](https://flrd.github.io/standardlastprofile/articles/algorithm-step-by-step.html).## Source
You can access the studies and data on standard load profiles for electricity on the website of the BDEW: https://www.bdew.de/energie/standardlastprofile-strom/## Code of Conduct
Please note that this project is released with a [Contributor Code of Conduct](https://github.com/flrd/standardlastprofile/blob/main/CODE_OF_CONDUCT.md).
By participating in this project you agree to abide by its terms.