Skip to contents

A river object contains information on river attributes at different aggregation levels. It can represent a real river network (obtained via rivnet::extract_river) or an optimal channel network (obtained via create_OCN).

The content of a river object can be treated as a list, hence its objects and sublists can be accessed with both the $ and @ operators.

For information on the aggregation levels and on the content of a river object, see OCNet-package.

Examples

show(OCN_20)
#> Class         : river 
#> Type          : Optimal Channel Network 
#> No. FD nodes  : 400 
#> Dimensions    : 20 x 20 
#> Cell size     : 1.00 
#> Has elevation : FALSE 
names(OCN_20)
#>  [1] "FD"                    "dimX"                  "dimY"                 
#>  [4] "cellsize"              "nOutlet"               "periodicBoundaries"   
#>  [7] "expEnergy"             "coolingRate"           "typeInitialState"     
#> [10] "nIter"                 "initialNoCoolingPhase" "energy"               
#> [13] "exitFlag"              "N4"                    "N8"                   
#> [16] "nIterSequence"         "energyInit"            "xllcorner"            
#> [19] "yllcorner"             "CM"                    "RN"                   
#> [22] "AG"                    "OptList"               "SC"                   
#> [25] "thrA"                  "slope0"                "zMin"                 
#> [28] "streamOrderType"       "maxReachLength"        "widthMax"             
#> [31] "depthMax"              "velocityMax"           "expWidth"             
#> [34] "expDepth"              "expVelocity"          

# extract or replace parts of a river object
OCN_20$dimX
#> [1] 20
OCN_20@dimX
#> [1] 20
dim <- OCN_20[["dimX"]]
OCN_20$dimX <- 1
OCN_20[["dimX"]]
#> [1] 1
OCN_20[["dimX"]] <- dim