Rescale Numeric Vector to a New Data Range
See also
Other tsl_processing_internal:
utils_drop_geometry()
,
utils_global_scaling_params()
,
utils_optimize_loess()
,
utils_optimize_spline()
Examples
out <- utils_rescale_vector(
x = stats::rnorm(100),
new_min = 0,
new_max = 100,
)
out
#> [1] 71.450357 49.311323 12.993000 30.830062 42.092997 57.562124
#> [7] 44.041569 53.701233 1.605933 83.939941 82.498802 58.224012
#> [13] 38.823489 22.756225 53.145613 10.057752 79.691292 63.629734
#> [19] 60.898210 47.396052 65.999561 54.343424 61.383882 92.831417
#> [25] 57.862896 52.865814 76.130181 63.905758 61.427852 24.944999
#> [31] 9.916552 0.000000 32.073052 50.435181 61.904200 56.862171
#> [37] 43.976953 48.172976 31.452909 23.058875 50.741249 66.964232
#> [43] 43.346099 67.760216 42.551881 25.853290 100.000000 56.196982
#> [49] 41.788626 54.959162 64.471501 22.986973 41.670844 42.460409
#> [55] 50.276340 54.451540 68.695871 52.665012 64.460095 90.757878
#> [61] 49.005045 35.228574 74.362842 17.005641 19.414867 58.920324
#> [67] 51.379186 77.326053 46.852822 47.874680 12.052198 11.754407
#> [73] 56.463301 52.152609 75.394480 42.625733 47.812082 67.877246
#> [79] 66.358079 35.497994 9.079772 75.031469 75.877622 62.813711
#> [85] 44.253666 26.433506 27.592542 63.807390 41.023811 65.434771
#> [91] 26.167907 85.007195 65.948922 45.178823 51.330965 43.915656
#> [97] 20.583033 49.535173 78.632919 46.842823