Augment Function Scale Zero One
Source:R/augment-hai-scale-zero-one.R
hai_scale_zero_one_augment.Rd
Takes a numeric vector and will return a vector that has been scaled from [0,1]
Arguments
- .data
The data being passed that will be augmented by the function.
- .value
This is passed
rlang::enquo()
to capture the vectors you want to augment.- .names
This is set to 'auto' by default but can be a user supplied character string.
Details
Takes a numeric vector and will return a vector that has been scaled from [0,1]
The input vector must be numeric. The computation is fairly straightforward.
This may be helpful when trying to compare the distributions of data where a
distribution like beta from the fitdistrplus
package which requires data to be
between 0 and 1
$$y[h] = (x - min(x))/(max(x) - min(x))$$
This function is intended to be used on its own in order to add columns to a tibble.
See also
Other Augment Function:
hai_fourier_augment()
,
hai_fourier_discrete_augment()
,
hai_hyperbolic_augment()
,
hai_polynomial_augment()
,
hai_scale_zscore_augment()
,
hai_winsorized_move_augment()
,
hai_winsorized_truncate_augment()
Other Scale:
hai_scale_zero_one_vec()
,
hai_scale_zscore_augment()
,
hai_scale_zscore_vec()
,
step_hai_scale_zscore()
Examples
df <- data.frame(x = rnorm(100, 2, 1))
hai_scale_zero_one_augment(df, x)
#> # A tibble: 100 × 2
#> x hai_scale_zero_one_x
#> <dbl> <dbl>
#> 1 0.108 0.0748
#> 2 2.75 0.656
#> 3 1.84 0.457
#> 4 2.08 0.510
#> 5 0.387 0.136
#> 6 1.55 0.394
#> 7 1.60 0.403
#> 8 1.27 0.331
#> 9 1.09 0.292
#> 10 3.90 0.911
#> # ℹ 90 more rows