
Last chance! 50% off unlimited learning
Sale ends in
This function changes the timestep of a table or an antaresData
object
and performs the required aggregation or desaggregation.Notice that
currently, the function performs the same operation on all the columns of a
table (either sum or mean). Check that this is effectively what you want to
do. If it is not the case, either select only the columns on which yo uwant
to perform the same operation or do not use it at all ! In future versions,
this function may have a smarter behavior.
changeTimeStep(x, newTimeStep, oldTimeStep, fun = "sum",
opts = simOptions())
data.table with a column "timeId" or an object of class "antaresDataList"
Desired time step.The possible values are hourly, daily, weekly, monthly and annual.
Current time step of the data. This argument is optional for an object of
class antaresData
because the time step of the data is stored inside
the object
Character vector with one element per column to (des)agregate indicating the function to use ("sum", "mean", "min" or "max") for this column. It can be a single element, in that case the same function is applied to every columns.
list of simulation parameters returned by the function
setSimulationPath
Either a data.table or an object of class "antaresDataList" depending on the
class of x
# NOT RUN {
setSimulationPath()
areasH <- readAntares(select = "LOAD", synthesis = FALSE, mcYears = 1)
areasD <- readAntares(select = "LOAD", synthesis = FALSE, mcYears = 1, timeStep ="daily")
areasDAgg <- changeTimeStep(areasH, "daily")
all.equal(areasDAgg$LOAD, areasD$LOAD)
# Use different aggregation functions
mydata <- readAntares(select = c("LOAD", "MRG. PRICE"), timeStep = "monthly")
changeTimeStep(mydata, "annual", fun = c("sum", "mean"))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab