Description Usage Arguments Details See Also Examples
View source: R/calculate_metrics.R
Given a time data object, summarize probabilities into metrics. The function automatically applies these calculation for each scenario, level of aggregation and area.
1 | calculate_metrics(time.data, outage.table, raw = FALSE, ...)
|
time.data |
Time series data formatted with |
outage.table |
Outage table used in the lookup, created with |
raw |
Return summary metrics ( |
... |
Additional parameters passed to |
The time data object must have a column called NetLoad
(see the examples for an easy
method to generate it).
Summary metrics include daily loss-of-load expectation (LOLE
), loss-of-load
hours (LOLH
), maximum LOLP (PeakLOLP
) and expected unserved energy
(EUE
).
format_timedata
and outage_table
to create time.data
and outage.table
objects, respectively
sliding_window
is used internally to extend time.data
calculate_elcc
uses this function to calculate ELCC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # Create outage table with 200 5-MW units
gens <- data.frame(Capacity = rep(5, 200),
EFOR = rep(0.08, 200))
out.table <- outage_table(gens)
# Create random load and wind data and format
tdata <- data.frame(Time = 1:8760,
Load = runif(8760, 450, 850),
Wind = runif(8760, 0, 100))
td <- format_timedata(tdata)
# Get metrics for net load (load - wind)
td2 <- td
td2$NetLoad <- td2$Load - td2$Wind
calculate_metrics(td2, out.table)
# Get metrics for just load
td3 <- td
td3$NetLoad <- td3$Load - td3$Wind
calculate_metrics(td3, out.table)
# Get raw data (i.e., not summarized)
calculate_metrics(td2, out.table, raw = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.