addCongestionLink: Add the congestion frequency and the number of congested...

View source: R/addCongestionLink.R

addCongestionLinkR Documentation

Description

This function computes 4 congestion variables of link (congestion frequency and congestion hours in direct and indirect direction) and adds them to an antaresData object. The input object must be at an hourly timestep.

Usage

addCongestionLink(x, timeStep = c("daily", "weekly", "monthly", "annual"))

Arguments

x

Object of class antaresData created with function readAntares. It must contain the columns CONG. PROB + and CONG. PROB - and be at an hourly timestep.

timeStep

character Desired time step for the result.

Value

addCongestionLink modifies its input by adding four columns:

congestionFrequencyDirect

This is the congestion frequency on the direct direction of the link at the specified time resolution.

congestionFrequencyDirect = round(sum((`CONG. PROB +` != 0)/.N), 2)
congestionFrequencyIndirect

This is the congestion frequency on the indirect direction of the link at the specified time resolution.

congestionFrequencyIndirect  = round(sum((`CONG. PROB -` != 0)/.N), 2)
congestionHoursDirect

This is the number of congestion hours on the direct direction of the link at the specified time resolution.

congestionHoursDirect  = sum(`CONG. PROB +` != 0)
congestionHoursIndirect

This is the number of congestion hours on the direct direction of the link at the specified time resolution.

congestionHoursIndirect =  sum(`CONG. PROB -` != 0)

Examples

## Not run: 
# Data required by the function

mydata <- readAntares(links = "all")
mydata <- addCongestionLink(mydata, timeStep = "daily")
names(mydata)

mydata <- addCongestionLink(mydata, timeStep = c('daily'))

## End(Not run)


antaresProcessing documentation built on June 25, 2024, 5:07 p.m.