Each of the numeric columns will have a mean of 0 and standard deviation of 1 after the transformation.

dfscaling(df, target)

Arguments

df

Data Frame

target

name of the target column

Value

scaled_df Data Frame

Examples

df <- tidyr::tibble(x = 1:5, y = seq(2,10, by = 2), z = x ^ 2 + y, target = c(1,1,0,1,0)) dfscaling(df, target)
#> # A tibble: 5 x 4 #> x y z target #> <dbl> <dbl> <dbl> <fct> #> 1 -1.26 -1.26 -1.09 1 #> 2 -0.632 -0.632 -0.704 1 #> 3 0 0 -0.156 0 #> 4 0.632 0.632 0.547 1 #> 5 1.26 1.26 1.41 0