add_op_periods: Add Operational Periods

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Uses DispatchedTime field in responses dataset and matches against operational period intervals. Adds a column named "op_period" with the value of period_name, an indice, and the interval in YYYY-MM-DD HH:MM:SS format.

Usage

1
2
3
4
5
6
7
add_op_periods(
  responses,
  startDate,
  endDate,
  period_length = 12,
  period_name = "Operational Period"
)

Arguments

responses

Source data set with the DispatchedTime POSIXct field

startDate

Date time of interval starts

endDate

Date time of interval ends

period_length

Length of each operational period in hours

period_name

Name to insert in column

Value

responses + op_period field

Examples

1
2
3
4
5
6
7
## Not run: 
startDate <- mdy_hms("02/14/2021 18:00:00", tz="US/Central")
endDate <- mdy_hms("02/19/2021 18:00:00", tz="US/Central")
add_op_periods(responses, startDate, endDate)

## End(Not run)
# adds op_period column with value of (e.g.) "Operational Period 1 (2021-02-14 18:00:00-2021-02-15 06:00:00)"

samuelkordik/esogettr documentation built on Dec. 22, 2021, 10:13 p.m.