Used to change the display of values in plot_graph2, to improve visualization
of min and max values
Usage
scale_to_range(x, new_min = 0.15, new_max = 8)
Arguments
- x
vector of values
- new_min
new minimum value. Default 0.15
- new_max
new maximum value. Default 8
Examples
1:5 |> scale_to_range(0, 1)
#> [1] 0.00 0.25 0.50 0.75 1.00
1:5 |> scale_to_range(2, 12)
#> [1] 2.0 4.5 7.0 9.5 12.0