Normalise data using different methods: log, power, and root, with a different number of parameters to find out which one transforms the data into a normal-ish set.
Original data.
Trait name.
Significance level.
Index of the current trait.
Transformation values.
Prefix for plots with or without path.
Significant digits to compare p-values of transformations.
Transformed record.
set.seed(123)
data <- rnorm(100, 5)
out_exp2 <- MetaPipe::transform_data(2 ^ data, "EXP_2")
#> Warning: Using ragg device as default. Ignoring `type` and `antialias` arguments
out_root2 <- MetaPipe::transform_data(sqrt(data), "ROOT_2")
#> Warning: Using ragg device as default. Ignoring `type` and `antialias` arguments
out_pow2 <- MetaPipe::transform_data(data ^ 2, "POW_2")
#> Warning: Using ragg device as default. Ignoring `type` and `antialias` arguments
knitr::kable(head(out_exp2))
#>
#>
#> |index |trait | values|flag |transf | transf_val|
#> |:-----|:-----|--------:|:------|:------|----------:|
#> | |EXP_2 | 4.439524|Normal |log | 2|
#> | |EXP_2 | 4.769823|Normal |log | 2|
#> | |EXP_2 | 6.558708|Normal |log | 2|
#> | |EXP_2 | 5.070508|Normal |log | 2|
#> | |EXP_2 | 5.129288|Normal |log | 2|
#> | |EXP_2 | 6.715065|Normal |log | 2|
knitr::kable(head(out_root2))
#>
#>
#> |index |trait | values|flag |transf | transf_val|
#> |:-----|:------|--------:|:------|:------|----------:|
#> | |ROOT_2 | 4.439524|Normal |power | 2|
#> | |ROOT_2 | 4.769823|Normal |power | 2|
#> | |ROOT_2 | 6.558708|Normal |power | 2|
#> | |ROOT_2 | 5.070508|Normal |power | 2|
#> | |ROOT_2 | 5.129288|Normal |power | 2|
#> | |ROOT_2 | 6.715065|Normal |power | 2|
knitr::kable(head(out_pow2))
#>
#>
#> |index |trait | values|flag |transf |transf_val |
#> |:-----|:-----|--------:|:------|:------|:----------|
#> | |POW_2 | 2.994219|Normal |root |e |
#> | |POW_2 | 3.156560|Normal |root |e |
#> | |POW_2 | 3.990077|Normal |root |e |
#> | |POW_2 | 3.301778|Normal |root |e |
#> | |POW_2 | 3.329897|Normal |root |e |
#> | |POW_2 | 4.059846|Normal |root |e |