View source: R/function_RescaleSLCClasses.R
RescaleSLCClasses | R Documentation |
RescaleSLCClasses
re-scales several or all SLC classes for each SUBID in a GeoData data frame
to a new target sum for all classes.
RescaleSLCClasses(gd, slc.exclude = NULL, target = 1, plot.box = TRUE)
gd |
A data frame containing columns 'SLC_n' ( |
slc.exclude |
Integer, SLC class numbers. Area fractions of classes listed here are kept fixed
during re-scaling. If |
target |
Numeric, target sum for SLC class fractions in each subbasin after re-scaling. Either a single
number or a vector with one value for each row in |
plot.box |
Logical, if |
RescaleSLCClasses
allows to rescale SLC classes, e.g. as part of a post-processing work flow during
HYPE model setup. Individual SLC classes can be excluded to protect. This can be useful e.g. for lake areas which
maybe must correspond to areas a LakeData file. The function will throw a warning if excluded SLC class fractions
are greater than sums provided in target
, but not if they are smaller.
RescaleSLCClasses
returns the data frame provided in gd
, with re-scaled SLC class fractions.
SumSLCClasses
for inspection of SLC class fraction sums in each subbasin
CleanSLCClasses
for pruning of small SLC fractions.
# Import source data
te <- ReadGeoData(filename = system.file("demo_model", "GeoData.txt", package = "HYPEtools"))
# Re-scale SLC classes, protect the first two
RescaleSLCClasses(gd = te, slc.exclude = 1:2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.