Skip to contents

Scales the values for each sample, where each row is independently processed.

Usage

scale_by_row__(data)

Details

The input is expected to be a data frame with the first column as the ID and the following columns containing observations at different time points. The ID column remains unaltered, and the other columns should be in double (dbl) format and will be scaled.

Examples

data(test_data)
scale_by_row__(test_data[1:5,1:10])
#>   ID          T1         T2          T3          T4          T5         T6
#> 1  1 -0.05847053 -0.5847053 -0.58470535 -0.05847053 -0.05847053 -0.5847053
#> 2  2  2.26366583 -0.6467617 -0.64676167 -0.64676167 -0.64676167  0.8084521
#> 3  3  0.22866478 -0.8003267 -0.80032673 -0.80032673  1.25765629 -0.8003267
#> 4  4  0.50395263  0.9575100  0.05039526  0.05039526  1.86462473 -0.4031621
#> 5  5  0.73869087  0.2841119          NA -0.17046712  1.19326987  1.1932699
#>           T7          T8         T9
#> 1 -0.5847053 -0.05847053  2.5727035
#> 2 -0.1616904 -0.64676167  0.3233808
#> 3 -0.8003267  1.25765629  1.2576563
#> 4 -0.8567195 -0.85671947 -1.3102768
#> 5 -1.0796251 -1.07962512 -1.0796251