if (FALSE) { # interactive() && traudem::can_register_taudem()
# \donttest{
fp <- system.file("extdata/wigger.tif", package="rivnet")
river <- extract_river(outlet=c(637478,237413),
DEM=fp)
river <- aggregate_river(river)
# land cover raster file (categorical)
r1 <- terra::rast(system.file("extdata/landcover.tif", package="rivnet"))
# legend: 1-urban; 2-agriculture; 3-forest; 4-improductive
river <- covariate_river(r1, river)
plot(river$SC$locCov[ , 1], river) # fraction of urban area within a subcatchment
plot(river$SC$upsCov[ , 1], river) # fraction of upstream-averaged urban area
# mean air temperature raster file (continuous)
r2 <- terra::rast(system.file("extdata/temperature.tif", package="rivnet"))
river <- covariate_river(r2, river, categorical = FALSE)
plot(river$SC$locCov[, 5], river) # the layer has been added after the 4 previous ones
names(river$SC$locCov)
# }
}
Run the code above in your browser using DataLab