format_timedata: Format time data

Description Usage Arguments Details Value See Also Examples

View source: R/timedata.R

Description

Create valid data container that has aggregated load and variable generation (VG) time series for different areas and levels of aggregation.

Usage

1
format_timedata(data, levels = NULL, scenario = NULL, day.steps = 24)

Arguments

data

Data frame with the load and VG time series (see details for requirements)

levels

Optional data frame that contains levels of aggregation, e.g., BAA, transmission area or interconnection (see details for requirements)

scenario

Name of columns in data used to denote different scenarios

day.steps

Number of data points in a day (defaults to 24)

Details

The columns identified by scenario are used to perform calculations separately. This way one can run different sensitivities in the same calculation (e.g., to estimate the capacity value of wind with different penetration levels).

Requirements for data:

Requirements for levels:

Value

A data frame with load and VG data aggregated by scenario and different areas and levels of aggregation

See Also

outage_table is the function that creates outage tables

sliding_window is used internally by several functions to extend time data objects

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Create data for two days
tdata <- data.frame(Area = c(rep("A", 48), rep("B", 48)),
                    Time = 1:48,
                    Load = c(runif(48, 200, 250), runif(48, 400, 450)),
                    Wind = c(runif(48, 20, 25), runif(48, 40, 45)))
levs <- data.frame(BAA = c("A", "B"), Region = c("All", "All"))

# Format time data without and with different levels of aggregation
td1 <- format_timedata(tdata)
head(td1)
td2 <- format_timedata(tdata, levs)
head(td2)

# Format time data with a scenario column
tdata2 <- tdata
tdata2$Scenario <- "Scenario 1"
td3 <- format_timedata(tdata2, scenario = "Scenario")
head(td3)

# Format time data without Area column (minimum example)
tdata3 <- tdata
tdata2$Area <- NULL
td4 <- format_timedata(tdata3)
head(td4)

NREL/repra documentation built on May 7, 2019, 6:03 p.m.