Skip to contents

Coerce a Rendata object into an object with class "potData".

Usage

# S3 method for Rendata
as.potData(object, ...)

Arguments

object

An object having the S3 class "Rendata" from the package Renext.

...

Not used for now. Should in the future allow to set or reset the names of the blocks using new arguments in potData.

Value

An object with the S3 class "potData" from the package potomax.

Note

When object contains empty OTS blocks a warning is cast when attempting to find the min of an empty block.

Examples

pdat <- as.potData(Garonne)
pdat1 <- potData(data = Garonne$OTdata$Flow,
                 effDuration = Garonne$OTinfo$effDuration,
                 MAX.data = Garonne$MAXdata$Flow,
                 MAX.effDuration = Garonne$MAXinfo$duration)
all.equal(pdat, pdat1)
#> [1] "Component “MAX”: Component “r”: names for target but not for current"
#> [2] "Component “MAX”: Component “data”: Names: 1 string mismatch"         

## OTS block #2 is empty
set.seed(123)
rd <- rRendata(effDuration = 10,
               OTS.effDuration = rep(60, 2),
               OTS.threshold = rep(80, 2),
               simDate = FALSE,
               distname.y = "GPD", par.y = c(scale = 20, shape = 0.16))
d <- as.potData(rd)
#> Warning: no non-missing arguments to min; returning Inf