Split a dataframe into a list according to the levels of variables in the dataframe and scale the numeric variables in each dataframe in the list.

scaleBy(formula, data = parent.frame(), center = TRUE, scale = TRUE)

scale_by(data, formula, center = TRUE, scale = TRUE)

Arguments

formula

Variables to split data frame by, as as.quoted variables, a formula or character vector.

data

A dataframe or matrix

center

Logical, should data be centered.

scale

Logical, should data be scaled.

Value

A list of objects of same class as x

Author

Søren Højsgaard, sorenh@math.aau.dk

Examples


scaleBy(~Species, data=iris, center=TRUE, scale=FALSE)
#> $setosa
#>    Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1         0.094       0.072       -0.062      -0.046  setosa
#> 2        -0.106      -0.428       -0.062      -0.046  setosa
#> 3        -0.306      -0.228       -0.162      -0.046  setosa
#> 4        -0.406      -0.328        0.038      -0.046  setosa
#> 5        -0.006       0.172       -0.062      -0.046  setosa
#> 6         0.394       0.472        0.238       0.154  setosa
#> 7        -0.406      -0.028       -0.062       0.054  setosa
#> 8        -0.006      -0.028        0.038      -0.046  setosa
#> 9        -0.606      -0.528       -0.062      -0.046  setosa
#> 10       -0.106      -0.328        0.038      -0.146  setosa
#> 11        0.394       0.272        0.038      -0.046  setosa
#> 12       -0.206      -0.028        0.138      -0.046  setosa
#> 13       -0.206      -0.428       -0.062      -0.146  setosa
#> 14       -0.706      -0.428       -0.362      -0.146  setosa
#> 15        0.794       0.572       -0.262      -0.046  setosa
#> 16        0.694       0.972        0.038       0.154  setosa
#> 17        0.394       0.472       -0.162       0.154  setosa
#> 18        0.094       0.072       -0.062       0.054  setosa
#> 19        0.694       0.372        0.238       0.054  setosa
#> 20        0.094       0.372        0.038       0.054  setosa
#> 21        0.394      -0.028        0.238      -0.046  setosa
#> 22        0.094       0.272        0.038       0.154  setosa
#> 23       -0.406       0.172       -0.462      -0.046  setosa
#> 24        0.094      -0.128        0.238       0.254  setosa
#> 25       -0.206      -0.028        0.438      -0.046  setosa
#> 26       -0.006      -0.428        0.138      -0.046  setosa
#> 27       -0.006      -0.028        0.138       0.154  setosa
#> 28        0.194       0.072        0.038      -0.046  setosa
#> 29        0.194      -0.028       -0.062      -0.046  setosa
#> 30       -0.306      -0.228        0.138      -0.046  setosa
#> 31       -0.206      -0.328        0.138      -0.046  setosa
#> 32        0.394      -0.028        0.038       0.154  setosa
#> 33        0.194       0.672        0.038      -0.146  setosa
#> 34        0.494       0.772       -0.062      -0.046  setosa
#> 35       -0.106      -0.328        0.038      -0.046  setosa
#> 36       -0.006      -0.228       -0.262      -0.046  setosa
#> 37        0.494       0.072       -0.162      -0.046  setosa
#> 38       -0.106       0.172       -0.062      -0.146  setosa
#> 39       -0.606      -0.428       -0.162      -0.046  setosa
#> 40        0.094      -0.028        0.038      -0.046  setosa
#> 41       -0.006       0.072       -0.162       0.054  setosa
#> 42       -0.506      -1.128       -0.162       0.054  setosa
#> 43       -0.606      -0.228       -0.162      -0.046  setosa
#> 44       -0.006       0.072        0.138       0.354  setosa
#> 45        0.094       0.372        0.438       0.154  setosa
#> 46       -0.206      -0.428       -0.062       0.054  setosa
#> 47        0.094       0.372        0.138      -0.046  setosa
#> 48       -0.406      -0.228       -0.062      -0.046  setosa
#> 49        0.294       0.272        0.038      -0.046  setosa
#> 50       -0.006      -0.128       -0.062      -0.046  setosa
#> 
#> $versicolor
#>     Sepal.Length Sepal.Width Petal.Length Petal.Width    Species
#> 51         1.064        0.43         0.44       0.074 versicolor
#> 52         0.464        0.43         0.24       0.174 versicolor
#> 53         0.964        0.33         0.64       0.174 versicolor
#> 54        -0.436       -0.47        -0.26      -0.026 versicolor
#> 55         0.564        0.03         0.34       0.174 versicolor
#> 56        -0.236        0.03         0.24      -0.026 versicolor
#> 57         0.364        0.53         0.44       0.274 versicolor
#> 58        -1.036       -0.37        -0.96      -0.326 versicolor
#> 59         0.664        0.13         0.34      -0.026 versicolor
#> 60        -0.736       -0.07        -0.36       0.074 versicolor
#> 61        -0.936       -0.77        -0.76      -0.326 versicolor
#> 62        -0.036        0.23        -0.06       0.174 versicolor
#> 63         0.064       -0.57        -0.26      -0.326 versicolor
#> 64         0.164        0.13         0.44       0.074 versicolor
#> 65        -0.336        0.13        -0.66      -0.026 versicolor
#> 66         0.764        0.33         0.14       0.074 versicolor
#> 67        -0.336        0.23         0.24       0.174 versicolor
#> 68        -0.136       -0.07        -0.16      -0.326 versicolor
#> 69         0.264       -0.57         0.24       0.174 versicolor
#> 70        -0.336       -0.27        -0.36      -0.226 versicolor
#> 71        -0.036        0.43         0.54       0.474 versicolor
#> 72         0.164        0.03        -0.26      -0.026 versicolor
#> 73         0.364       -0.27         0.64       0.174 versicolor
#> 74         0.164        0.03         0.44      -0.126 versicolor
#> 75         0.464        0.13         0.04      -0.026 versicolor
#> 76         0.664        0.23         0.14       0.074 versicolor
#> 77         0.864        0.03         0.54       0.074 versicolor
#> 78         0.764        0.23         0.74       0.374 versicolor
#> 79         0.064        0.13         0.24       0.174 versicolor
#> 80        -0.236       -0.17        -0.76      -0.326 versicolor
#> 81        -0.436       -0.37        -0.46      -0.226 versicolor
#> 82        -0.436       -0.37        -0.56      -0.326 versicolor
#> 83        -0.136       -0.07        -0.36      -0.126 versicolor
#> 84         0.064       -0.07         0.84       0.274 versicolor
#> 85        -0.536        0.23         0.24       0.174 versicolor
#> 86         0.064        0.63         0.24       0.274 versicolor
#> 87         0.764        0.33         0.44       0.174 versicolor
#> 88         0.364       -0.47         0.14      -0.026 versicolor
#> 89        -0.336        0.23        -0.16      -0.026 versicolor
#> 90        -0.436       -0.27        -0.26      -0.026 versicolor
#> 91        -0.436       -0.17         0.14      -0.126 versicolor
#> 92         0.164        0.23         0.34       0.074 versicolor
#> 93        -0.136       -0.17        -0.26      -0.126 versicolor
#> 94        -0.936       -0.47        -0.96      -0.326 versicolor
#> 95        -0.336       -0.07        -0.06      -0.026 versicolor
#> 96        -0.236        0.23        -0.06      -0.126 versicolor
#> 97        -0.236        0.13        -0.06      -0.026 versicolor
#> 98         0.264        0.13         0.04      -0.026 versicolor
#> 99        -0.836       -0.27        -1.26      -0.226 versicolor
#> 100       -0.236        0.03        -0.16      -0.026 versicolor
#> 
#> $virginica
#>     Sepal.Length Sepal.Width Petal.Length Petal.Width   Species
#> 101       -0.288       0.326        0.448       0.474 virginica
#> 102       -0.788      -0.274       -0.452      -0.126 virginica
#> 103        0.512       0.026        0.348       0.074 virginica
#> 104       -0.288      -0.074        0.048      -0.226 virginica
#> 105       -0.088       0.026        0.248       0.174 virginica
#> 106        1.012       0.026        1.048       0.074 virginica
#> 107       -1.688      -0.474       -1.052      -0.326 virginica
#> 108        0.712      -0.074        0.748      -0.226 virginica
#> 109        0.112      -0.474        0.248      -0.226 virginica
#> 110        0.612       0.626        0.548       0.474 virginica
#> 111       -0.088       0.226       -0.452      -0.026 virginica
#> 112       -0.188      -0.274       -0.252      -0.126 virginica
#> 113        0.212       0.026       -0.052       0.074 virginica
#> 114       -0.888      -0.474       -0.552      -0.026 virginica
#> 115       -0.788      -0.174       -0.452       0.374 virginica
#> 116       -0.188       0.226       -0.252       0.274 virginica
#> 117       -0.088       0.026       -0.052      -0.226 virginica
#> 118        1.112       0.826        1.148       0.174 virginica
#> 119        1.112      -0.374        1.348       0.274 virginica
#> 120       -0.588      -0.774       -0.552      -0.526 virginica
#> 121        0.312       0.226        0.148       0.274 virginica
#> 122       -0.988      -0.174       -0.652      -0.026 virginica
#> 123        1.112      -0.174        1.148      -0.026 virginica
#> 124       -0.288      -0.274       -0.652      -0.226 virginica
#> 125        0.112       0.326        0.148       0.074 virginica
#> 126        0.612       0.226        0.448      -0.226 virginica
#> 127       -0.388      -0.174       -0.752      -0.226 virginica
#> 128       -0.488       0.026       -0.652      -0.226 virginica
#> 129       -0.188      -0.174        0.048       0.074 virginica
#> 130        0.612       0.026        0.248      -0.426 virginica
#> 131        0.812      -0.174        0.548      -0.126 virginica
#> 132        1.312       0.826        0.848      -0.026 virginica
#> 133       -0.188      -0.174        0.048       0.174 virginica
#> 134       -0.288      -0.174       -0.452      -0.526 virginica
#> 135       -0.488      -0.374        0.048      -0.626 virginica
#> 136        1.112       0.026        0.548       0.274 virginica
#> 137       -0.288       0.426        0.048       0.374 virginica
#> 138       -0.188       0.126       -0.052      -0.226 virginica
#> 139       -0.588       0.026       -0.752      -0.226 virginica
#> 140        0.312       0.126       -0.152       0.074 virginica
#> 141        0.112       0.126        0.048       0.374 virginica
#> 142        0.312       0.126       -0.452       0.274 virginica
#> 143       -0.788      -0.274       -0.452      -0.126 virginica
#> 144        0.212       0.226        0.348       0.274 virginica
#> 145        0.112       0.326        0.148       0.474 virginica
#> 146        0.112       0.026       -0.352       0.274 virginica
#> 147       -0.288      -0.474       -0.552      -0.126 virginica
#> 148       -0.088       0.026       -0.352      -0.026 virginica
#> 149       -0.388       0.426       -0.152       0.274 virginica
#> 150       -0.688       0.026       -0.452      -0.226 virginica
#> 
scaleBy(~1, data=iris, center=TRUE, scale=FALSE)
#> $`1`
#>     Sepal.Length Sepal.Width Petal.Length   Petal.Width    Species
#> 1    -0.74333333  0.44266667       -2.358 -0.9993333333     setosa
#> 2    -0.94333333 -0.05733333       -2.358 -0.9993333333     setosa
#> 3    -1.14333333  0.14266667       -2.458 -0.9993333333     setosa
#> 4    -1.24333333  0.04266667       -2.258 -0.9993333333     setosa
#> 5    -0.84333333  0.54266667       -2.358 -0.9993333333     setosa
#> 6    -0.44333333  0.84266667       -2.058 -0.7993333333     setosa
#> 7    -1.24333333  0.34266667       -2.358 -0.8993333333     setosa
#> 8    -0.84333333  0.34266667       -2.258 -0.9993333333     setosa
#> 9    -1.44333333 -0.15733333       -2.358 -0.9993333333     setosa
#> 10   -0.94333333  0.04266667       -2.258 -1.0993333333     setosa
#> 11   -0.44333333  0.64266667       -2.258 -0.9993333333     setosa
#> 12   -1.04333333  0.34266667       -2.158 -0.9993333333     setosa
#> 13   -1.04333333 -0.05733333       -2.358 -1.0993333333     setosa
#> 14   -1.54333333 -0.05733333       -2.658 -1.0993333333     setosa
#> 15   -0.04333333  0.94266667       -2.558 -0.9993333333     setosa
#> 16   -0.14333333  1.34266667       -2.258 -0.7993333333     setosa
#> 17   -0.44333333  0.84266667       -2.458 -0.7993333333     setosa
#> 18   -0.74333333  0.44266667       -2.358 -0.8993333333     setosa
#> 19   -0.14333333  0.74266667       -2.058 -0.8993333333     setosa
#> 20   -0.74333333  0.74266667       -2.258 -0.8993333333     setosa
#> 21   -0.44333333  0.34266667       -2.058 -0.9993333333     setosa
#> 22   -0.74333333  0.64266667       -2.258 -0.7993333333     setosa
#> 23   -1.24333333  0.54266667       -2.758 -0.9993333333     setosa
#> 24   -0.74333333  0.24266667       -2.058 -0.6993333333     setosa
#> 25   -1.04333333  0.34266667       -1.858 -0.9993333333     setosa
#> 26   -0.84333333 -0.05733333       -2.158 -0.9993333333     setosa
#> 27   -0.84333333  0.34266667       -2.158 -0.7993333333     setosa
#> 28   -0.64333333  0.44266667       -2.258 -0.9993333333     setosa
#> 29   -0.64333333  0.34266667       -2.358 -0.9993333333     setosa
#> 30   -1.14333333  0.14266667       -2.158 -0.9993333333     setosa
#> 31   -1.04333333  0.04266667       -2.158 -0.9993333333     setosa
#> 32   -0.44333333  0.34266667       -2.258 -0.7993333333     setosa
#> 33   -0.64333333  1.04266667       -2.258 -1.0993333333     setosa
#> 34   -0.34333333  1.14266667       -2.358 -0.9993333333     setosa
#> 35   -0.94333333  0.04266667       -2.258 -0.9993333333     setosa
#> 36   -0.84333333  0.14266667       -2.558 -0.9993333333     setosa
#> 37   -0.34333333  0.44266667       -2.458 -0.9993333333     setosa
#> 38   -0.94333333  0.54266667       -2.358 -1.0993333333     setosa
#> 39   -1.44333333 -0.05733333       -2.458 -0.9993333333     setosa
#> 40   -0.74333333  0.34266667       -2.258 -0.9993333333     setosa
#> 41   -0.84333333  0.44266667       -2.458 -0.8993333333     setosa
#> 42   -1.34333333 -0.75733333       -2.458 -0.8993333333     setosa
#> 43   -1.44333333  0.14266667       -2.458 -0.9993333333     setosa
#> 44   -0.84333333  0.44266667       -2.158 -0.5993333333     setosa
#> 45   -0.74333333  0.74266667       -1.858 -0.7993333333     setosa
#> 46   -1.04333333 -0.05733333       -2.358 -0.8993333333     setosa
#> 47   -0.74333333  0.74266667       -2.158 -0.9993333333     setosa
#> 48   -1.24333333  0.14266667       -2.358 -0.9993333333     setosa
#> 49   -0.54333333  0.64266667       -2.258 -0.9993333333     setosa
#> 50   -0.84333333  0.24266667       -2.358 -0.9993333333     setosa
#> 51    1.15666667  0.14266667        0.942  0.2006666667 versicolor
#> 52    0.55666667  0.14266667        0.742  0.3006666667 versicolor
#> 53    1.05666667  0.04266667        1.142  0.3006666667 versicolor
#> 54   -0.34333333 -0.75733333        0.242  0.1006666667 versicolor
#> 55    0.65666667 -0.25733333        0.842  0.3006666667 versicolor
#> 56   -0.14333333 -0.25733333        0.742  0.1006666667 versicolor
#> 57    0.45666667  0.24266667        0.942  0.4006666667 versicolor
#> 58   -0.94333333 -0.65733333       -0.458 -0.1993333333 versicolor
#> 59    0.75666667 -0.15733333        0.842  0.1006666667 versicolor
#> 60   -0.64333333 -0.35733333        0.142  0.2006666667 versicolor
#> 61   -0.84333333 -1.05733333       -0.258 -0.1993333333 versicolor
#> 62    0.05666667 -0.05733333        0.442  0.3006666667 versicolor
#> 63    0.15666667 -0.85733333        0.242 -0.1993333333 versicolor
#> 64    0.25666667 -0.15733333        0.942  0.2006666667 versicolor
#> 65   -0.24333333 -0.15733333       -0.158  0.1006666667 versicolor
#> 66    0.85666667  0.04266667        0.642  0.2006666667 versicolor
#> 67   -0.24333333 -0.05733333        0.742  0.3006666667 versicolor
#> 68   -0.04333333 -0.35733333        0.342 -0.1993333333 versicolor
#> 69    0.35666667 -0.85733333        0.742  0.3006666667 versicolor
#> 70   -0.24333333 -0.55733333        0.142 -0.0993333333 versicolor
#> 71    0.05666667  0.14266667        1.042  0.6006666667 versicolor
#> 72    0.25666667 -0.25733333        0.242  0.1006666667 versicolor
#> 73    0.45666667 -0.55733333        1.142  0.3006666667 versicolor
#> 74    0.25666667 -0.25733333        0.942  0.0006666667 versicolor
#> 75    0.55666667 -0.15733333        0.542  0.1006666667 versicolor
#> 76    0.75666667 -0.05733333        0.642  0.2006666667 versicolor
#> 77    0.95666667 -0.25733333        1.042  0.2006666667 versicolor
#> 78    0.85666667 -0.05733333        1.242  0.5006666667 versicolor
#> 79    0.15666667 -0.15733333        0.742  0.3006666667 versicolor
#> 80   -0.14333333 -0.45733333       -0.258 -0.1993333333 versicolor
#> 81   -0.34333333 -0.65733333        0.042 -0.0993333333 versicolor
#> 82   -0.34333333 -0.65733333       -0.058 -0.1993333333 versicolor
#> 83   -0.04333333 -0.35733333        0.142  0.0006666667 versicolor
#> 84    0.15666667 -0.35733333        1.342  0.4006666667 versicolor
#> 85   -0.44333333 -0.05733333        0.742  0.3006666667 versicolor
#> 86    0.15666667  0.34266667        0.742  0.4006666667 versicolor
#> 87    0.85666667  0.04266667        0.942  0.3006666667 versicolor
#> 88    0.45666667 -0.75733333        0.642  0.1006666667 versicolor
#> 89   -0.24333333 -0.05733333        0.342  0.1006666667 versicolor
#> 90   -0.34333333 -0.55733333        0.242  0.1006666667 versicolor
#> 91   -0.34333333 -0.45733333        0.642  0.0006666667 versicolor
#> 92    0.25666667 -0.05733333        0.842  0.2006666667 versicolor
#> 93   -0.04333333 -0.45733333        0.242  0.0006666667 versicolor
#> 94   -0.84333333 -0.75733333       -0.458 -0.1993333333 versicolor
#> 95   -0.24333333 -0.35733333        0.442  0.1006666667 versicolor
#> 96   -0.14333333 -0.05733333        0.442  0.0006666667 versicolor
#> 97   -0.14333333 -0.15733333        0.442  0.1006666667 versicolor
#> 98    0.35666667 -0.15733333        0.542  0.1006666667 versicolor
#> 99   -0.74333333 -0.55733333       -0.758 -0.0993333333 versicolor
#> 100  -0.14333333 -0.25733333        0.342  0.1006666667 versicolor
#> 101   0.45666667  0.24266667        2.242  1.3006666667  virginica
#> 102  -0.04333333 -0.35733333        1.342  0.7006666667  virginica
#> 103   1.25666667 -0.05733333        2.142  0.9006666667  virginica
#> 104   0.45666667 -0.15733333        1.842  0.6006666667  virginica
#> 105   0.65666667 -0.05733333        2.042  1.0006666667  virginica
#> 106   1.75666667 -0.05733333        2.842  0.9006666667  virginica
#> 107  -0.94333333 -0.55733333        0.742  0.5006666667  virginica
#> 108   1.45666667 -0.15733333        2.542  0.6006666667  virginica
#> 109   0.85666667 -0.55733333        2.042  0.6006666667  virginica
#> 110   1.35666667  0.54266667        2.342  1.3006666667  virginica
#> 111   0.65666667  0.14266667        1.342  0.8006666667  virginica
#> 112   0.55666667 -0.35733333        1.542  0.7006666667  virginica
#> 113   0.95666667 -0.05733333        1.742  0.9006666667  virginica
#> 114  -0.14333333 -0.55733333        1.242  0.8006666667  virginica
#> 115  -0.04333333 -0.25733333        1.342  1.2006666667  virginica
#> 116   0.55666667  0.14266667        1.542  1.1006666667  virginica
#> 117   0.65666667 -0.05733333        1.742  0.6006666667  virginica
#> 118   1.85666667  0.74266667        2.942  1.0006666667  virginica
#> 119   1.85666667 -0.45733333        3.142  1.1006666667  virginica
#> 120   0.15666667 -0.85733333        1.242  0.3006666667  virginica
#> 121   1.05666667  0.14266667        1.942  1.1006666667  virginica
#> 122  -0.24333333 -0.25733333        1.142  0.8006666667  virginica
#> 123   1.85666667 -0.25733333        2.942  0.8006666667  virginica
#> 124   0.45666667 -0.35733333        1.142  0.6006666667  virginica
#> 125   0.85666667  0.24266667        1.942  0.9006666667  virginica
#> 126   1.35666667  0.14266667        2.242  0.6006666667  virginica
#> 127   0.35666667 -0.25733333        1.042  0.6006666667  virginica
#> 128   0.25666667 -0.05733333        1.142  0.6006666667  virginica
#> 129   0.55666667 -0.25733333        1.842  0.9006666667  virginica
#> 130   1.35666667 -0.05733333        2.042  0.4006666667  virginica
#> 131   1.55666667 -0.25733333        2.342  0.7006666667  virginica
#> 132   2.05666667  0.74266667        2.642  0.8006666667  virginica
#> 133   0.55666667 -0.25733333        1.842  1.0006666667  virginica
#> 134   0.45666667 -0.25733333        1.342  0.3006666667  virginica
#> 135   0.25666667 -0.45733333        1.842  0.2006666667  virginica
#> 136   1.85666667 -0.05733333        2.342  1.1006666667  virginica
#> 137   0.45666667  0.34266667        1.842  1.2006666667  virginica
#> 138   0.55666667  0.04266667        1.742  0.6006666667  virginica
#> 139   0.15666667 -0.05733333        1.042  0.6006666667  virginica
#> 140   1.05666667  0.04266667        1.642  0.9006666667  virginica
#> 141   0.85666667  0.04266667        1.842  1.2006666667  virginica
#> 142   1.05666667  0.04266667        1.342  1.1006666667  virginica
#> 143  -0.04333333 -0.35733333        1.342  0.7006666667  virginica
#> 144   0.95666667  0.14266667        2.142  1.1006666667  virginica
#> 145   0.85666667  0.24266667        1.942  1.3006666667  virginica
#> 146   0.85666667 -0.05733333        1.442  1.1006666667  virginica
#> 147   0.45666667 -0.55733333        1.242  0.7006666667  virginica
#> 148   0.65666667 -0.05733333        1.442  0.8006666667  virginica
#> 149   0.35666667  0.34266667        1.642  1.1006666667  virginica
#> 150   0.05666667 -0.05733333        1.342  0.6006666667  virginica
#> 

scale_by(iris, ~Species)
#> $setosa
#>    Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1    0.26667447  0.18994136   -0.3570112  -0.4364923  setosa
#> 2   -0.30071802 -1.12909583   -0.3570112  -0.4364923  setosa
#> 3   -0.86811050 -0.60148096   -0.9328358  -0.4364923  setosa
#> 4   -1.15180675 -0.86528840    0.2188133  -0.4364923  setosa
#> 5   -0.01702177  0.45374879   -0.3570112  -0.4364923  setosa
#> 6    1.11776320  1.24517111    1.3704625   1.4613004  setosa
#> 7   -1.15180675 -0.07386608   -0.3570112   0.5124040  setosa
#> 8   -0.01702177 -0.07386608    0.2188133  -0.4364923  setosa
#> 9   -1.71919923 -1.39290327   -0.3570112  -0.4364923  setosa
#> 10  -0.30071802 -0.86528840    0.2188133  -1.3853887  setosa
#> 11   1.11776320  0.71755623    0.2188133  -0.4364923  setosa
#> 12  -0.58441426 -0.07386608    0.7946379  -0.4364923  setosa
#> 13  -0.58441426 -1.12909583   -0.3570112  -1.3853887  setosa
#> 14  -2.00289548 -1.12909583   -2.0844850  -1.3853887  setosa
#> 15   2.25254817  1.50897854   -1.5086604  -0.4364923  setosa
#> 16   1.96885193  2.56420830    0.2188133   1.4613004  setosa
#> 17   1.11776320  1.24517111   -0.9328358   1.4613004  setosa
#> 18   0.26667447  0.18994136   -0.3570112   0.5124040  setosa
#> 19   1.96885193  0.98136367    1.3704625   0.5124040  setosa
#> 20   0.26667447  0.98136367    0.2188133   0.5124040  setosa
#> 21   1.11776320 -0.07386608    1.3704625  -0.4364923  setosa
#> 22   0.26667447  0.71755623    0.2188133   1.4613004  setosa
#> 23  -1.15180675  0.45374879   -2.6603096  -0.4364923  setosa
#> 24   0.26667447 -0.33767352    1.3704625   2.4101967  setosa
#> 25  -0.58441426 -0.07386608    2.5221117  -0.4364923  setosa
#> 26  -0.01702177 -1.12909583    0.7946379  -0.4364923  setosa
#> 27  -0.01702177 -0.07386608    0.7946379   1.4613004  setosa
#> 28   0.55037071  0.18994136    0.2188133  -0.4364923  setosa
#> 29   0.55037071 -0.07386608   -0.3570112  -0.4364923  setosa
#> 30  -0.86811050 -0.60148096    0.7946379  -0.4364923  setosa
#> 31  -0.58441426 -0.86528840    0.7946379  -0.4364923  setosa
#> 32   1.11776320 -0.07386608    0.2188133   1.4613004  setosa
#> 33   0.55037071  1.77278598    0.2188133  -1.3853887  setosa
#> 34   1.40145944  2.03659342   -0.3570112  -0.4364923  setosa
#> 35  -0.30071802 -0.86528840    0.2188133  -0.4364923  setosa
#> 36  -0.01702177 -0.60148096   -1.5086604  -0.4364923  setosa
#> 37   1.40145944  0.18994136   -0.9328358  -0.4364923  setosa
#> 38  -0.30071802  0.45374879   -0.3570112  -1.3853887  setosa
#> 39  -1.71919923 -1.12909583   -0.9328358  -0.4364923  setosa
#> 40   0.26667447 -0.07386608    0.2188133  -0.4364923  setosa
#> 41  -0.01702177  0.18994136   -0.9328358   0.5124040  setosa
#> 42  -1.43550299 -2.97574790   -0.9328358   0.5124040  setosa
#> 43  -1.71919923 -0.60148096   -0.9328358  -0.4364923  setosa
#> 44  -0.01702177  0.18994136    0.7946379   3.3590930  setosa
#> 45   0.26667447  0.98136367    2.5221117   1.4613004  setosa
#> 46  -0.58441426 -1.12909583   -0.3570112   0.5124040  setosa
#> 47   0.26667447  0.98136367    0.7946379  -0.4364923  setosa
#> 48  -1.15180675 -0.60148096   -0.3570112  -0.4364923  setosa
#> 49   0.83406695  0.71755623    0.2188133  -0.4364923  setosa
#> 50  -0.01702177 -0.33767352   -0.3570112  -0.4364923  setosa
#> 
#> $versicolor
#>     Sepal.Length Sepal.Width Petal.Length Petal.Width    Species
#> 51    2.06133180  1.37030688   0.93634757   0.3742048 versicolor
#> 52    0.89892665  1.37030688   0.51073504   0.8798869 versicolor
#> 53    1.86759761  1.05163086   1.36196010   0.8798869 versicolor
#> 54   -0.84468108 -1.49777728  -0.55329629  -0.1314774 versicolor
#> 55    1.09266084  0.09560281   0.72354130   0.8798869 versicolor
#> 56   -0.45721269  0.09560281   0.51073504  -0.1314774 versicolor
#> 57    0.70519246  1.68898289   0.93634757   1.3855691 versicolor
#> 58   -2.00708623 -1.17910126  -2.04294015  -1.6485238 versicolor
#> 59    1.28639503  0.41427882   0.72354130  -0.1314774 versicolor
#> 60   -1.42588365 -0.22307321  -0.76610255   0.3742048 versicolor
#> 61   -1.81335204 -2.45380533  -1.61732761  -1.6485238 versicolor
#> 62   -0.06974431  0.73295484  -0.12768376   0.8798869 versicolor
#> 63    0.12398988 -1.81645330  -0.55329629  -1.6485238 versicolor
#> 64    0.31772407  0.41427882   0.93634757   0.3742048 versicolor
#> 65   -0.65094688  0.41427882  -1.40452135  -0.1314774 versicolor
#> 66    1.48012923  1.05163086   0.29792877   0.3742048 versicolor
#> 67   -0.65094688  0.73295484   0.51073504   0.8798869 versicolor
#> 68   -0.26347850 -0.22307321  -0.34049002  -1.6485238 versicolor
#> 69    0.51145827 -1.81645330   0.51073504   0.8798869 versicolor
#> 70   -0.65094688 -0.86042525  -0.76610255  -1.1428417 versicolor
#> 71   -0.06974431  1.37030688   1.14915383   2.3969334 versicolor
#> 72    0.31772407  0.09560281  -0.55329629  -0.1314774 versicolor
#> 73    0.70519246 -0.86042525   1.36196010   0.8798869 versicolor
#> 74    0.31772407  0.09560281   0.93634757  -0.6371595 versicolor
#> 75    0.89892665  0.41427882   0.08512251  -0.1314774 versicolor
#> 76    1.28639503  0.73295484   0.29792877   0.3742048 versicolor
#> 77    1.67386342  0.09560281   1.14915383   0.3742048 versicolor
#> 78    1.48012923  0.73295484   1.57476636   1.8912512 versicolor
#> 79    0.12398988  0.41427882   0.51073504   0.8798869 versicolor
#> 80   -0.45721269 -0.54174923  -1.61732761  -1.6485238 versicolor
#> 81   -0.84468108 -1.17910126  -0.97890882  -1.1428417 versicolor
#> 82   -0.84468108 -1.17910126  -1.19171508  -1.6485238 versicolor
#> 83   -0.26347850 -0.22307321  -0.76610255  -0.6371595 versicolor
#> 84    0.12398988 -0.22307321   1.78757263   1.3855691 versicolor
#> 85   -1.03841527  0.73295484   0.51073504   0.8798869 versicolor
#> 86    0.12398988  2.00765891   0.51073504   1.3855691 versicolor
#> 87    1.48012923  1.05163086   0.93634757   0.8798869 versicolor
#> 88    0.70519246 -1.49777728   0.29792877  -0.1314774 versicolor
#> 89   -0.65094688  0.73295484  -0.34049002  -0.1314774 versicolor
#> 90   -0.84468108 -0.86042525  -0.55329629  -0.1314774 versicolor
#> 91   -0.84468108 -0.54174923   0.29792877  -0.6371595 versicolor
#> 92    0.31772407  0.73295484   0.72354130   0.3742048 versicolor
#> 93   -0.26347850 -0.54174923  -0.55329629  -0.6371595 versicolor
#> 94   -1.81335204 -1.49777728  -2.04294015  -1.6485238 versicolor
#> 95   -0.65094688 -0.22307321  -0.12768376  -0.1314774 versicolor
#> 96   -0.45721269  0.73295484  -0.12768376  -0.6371595 versicolor
#> 97   -0.45721269  0.41427882  -0.12768376  -0.1314774 versicolor
#> 98    0.51145827  0.41427882   0.08512251  -0.1314774 versicolor
#> 99   -1.61961784 -0.86042525  -2.68135894  -1.1428417 versicolor
#> 100  -0.45721269  0.09560281  -0.34049002  -0.1314774 versicolor
#> 
#> $virginica
#>     Sepal.Length Sepal.Width Petal.Length Petal.Width   Species
#> 101   -0.4529159   1.0108633   0.81174906  1.72583253 virginica
#> 102   -1.2392283  -0.8496213  -0.81899682 -0.45876561 virginica
#> 103    0.8051839   0.0806210   0.63055507  0.26943377 virginica
#> 104   -0.4529159  -0.2294598   0.08697311 -0.82286530 virginica
#> 105   -0.1383910   0.0806210   0.44936109  0.63353346 virginica
#> 106    1.5914963   0.0806210   1.89891298  0.26943377 virginica
#> 107   -2.6545906  -1.4697828  -1.90616074 -1.18696499 virginica
#> 108    1.1197088  -0.2294598   1.35533102 -0.82286530 virginica
#> 109    0.1761340  -1.4697828   0.44936109 -0.82286530 virginica
#> 110    0.9624464   1.9411055   0.99294305  1.72583253 virginica
#> 111   -0.1383910   0.7007825  -0.81899682 -0.09466592 virginica
#> 112   -0.2956535  -0.8496213  -0.45660885 -0.45876561 virginica
#> 113    0.3333965   0.0806210  -0.09422087  0.26943377 virginica
#> 114   -1.3964908  -1.4697828  -1.00019081 -0.09466592 virginica
#> 115   -1.2392283  -0.5395405  -0.81899682  1.36173284 virginica
#> 116   -0.2956535   0.7007825  -0.45660885  0.99763315 virginica
#> 117   -0.1383910   0.0806210  -0.09422087 -0.82286530 virginica
#> 118    1.7487587   2.5612670   2.08010696  0.63353346 virginica
#> 119    1.7487587  -1.1597020   2.44249494  0.99763315 virginica
#> 120   -0.9247034  -2.4000250  -1.00019081 -1.91516437 virginica
#> 121    0.4906589   0.7007825   0.26816710  0.99763315 virginica
#> 122   -1.5537533  -0.5395405  -1.18138479 -0.09466592 virginica
#> 123    1.7487587  -0.5395405   2.08010696 -0.09466592 virginica
#> 124   -0.4529159  -0.8496213  -1.18138479 -0.82286530 virginica
#> 125    0.1761340   1.0108633   0.26816710  0.26943377 virginica
#> 126    0.9624464   0.7007825   0.81174906 -0.82286530 virginica
#> 127   -0.6101784  -0.5395405  -1.36257878 -0.82286530 virginica
#> 128   -0.7674409   0.0806210  -1.18138479 -0.82286530 virginica
#> 129   -0.2956535  -0.5395405   0.08697311  0.26943377 virginica
#> 130    0.9624464   0.0806210   0.44936109 -1.55106468 virginica
#> 131    1.2769713  -0.5395405   0.99294305 -0.45876561 virginica
#> 132    2.0632837   2.5612670   1.53652500 -0.09466592 virginica
#> 133   -0.2956535  -0.5395405   0.08697311  0.63353346 virginica
#> 134   -0.4529159  -0.5395405  -0.81899682 -1.91516437 virginica
#> 135   -0.7674409  -1.1597020   0.08697311 -2.27926406 virginica
#> 136    1.7487587   0.0806210   0.99294305  0.99763315 virginica
#> 137   -0.4529159   1.3209440   0.08697311  1.36173284 virginica
#> 138   -0.2956535   0.3907017  -0.09422087 -0.82286530 virginica
#> 139   -0.9247034   0.0806210  -1.36257878 -0.82286530 virginica
#> 140    0.4906589   0.3907017  -0.27541486  0.26943377 virginica
#> 141    0.1761340   0.3907017   0.08697311  1.36173284 virginica
#> 142    0.4906589   0.3907017  -0.81899682  0.99763315 virginica
#> 143   -1.2392283  -0.8496213  -0.81899682 -0.45876561 virginica
#> 144    0.3333965   0.7007825   0.63055507  0.99763315 virginica
#> 145    0.1761340   1.0108633   0.26816710  1.72583253 virginica
#> 146    0.1761340   0.0806210  -0.63780283  0.99763315 virginica
#> 147   -0.4529159  -1.4697828  -1.00019081 -0.45876561 virginica
#> 148   -0.1383910   0.0806210  -0.63780283 -0.09466592 virginica
#> 149   -0.6101784   1.3209440  -0.27541486  0.99763315 virginica
#> 150   -1.0819658   0.0806210  -0.81899682 -0.82286530 virginica
#> 
scale_by(iris, ~1)
#> $`1`
#>     Sepal.Length Sepal.Width Petal.Length   Petal.Width    Species
#> 1    -0.89767388  1.01560199  -1.33575163 -1.3110521482     setosa
#> 2    -1.13920048 -0.13153881  -1.33575163 -1.3110521482     setosa
#> 3    -1.38072709  0.32731751  -1.39239929 -1.3110521482     setosa
#> 4    -1.50149039  0.09788935  -1.27910398 -1.3110521482     setosa
#> 5    -1.01843718  1.24503015  -1.33575163 -1.3110521482     setosa
#> 6    -0.53538397  1.93331463  -1.16580868 -1.0486667950     setosa
#> 7    -1.50149039  0.78617383  -1.33575163 -1.1798594716     setosa
#> 8    -1.01843718  0.78617383  -1.27910398 -1.3110521482     setosa
#> 9    -1.74301699 -0.36096697  -1.33575163 -1.3110521482     setosa
#> 10   -1.13920048  0.09788935  -1.27910398 -1.4422448248     setosa
#> 11   -0.53538397  1.47445831  -1.27910398 -1.3110521482     setosa
#> 12   -1.25996379  0.78617383  -1.22245633 -1.3110521482     setosa
#> 13   -1.25996379 -0.13153881  -1.33575163 -1.4422448248     setosa
#> 14   -1.86378030 -0.13153881  -1.50569459 -1.4422448248     setosa
#> 15   -0.05233076  2.16274279  -1.44904694 -1.3110521482     setosa
#> 16   -0.17309407  3.08045544  -1.27910398 -1.0486667950     setosa
#> 17   -0.53538397  1.93331463  -1.39239929 -1.0486667950     setosa
#> 18   -0.89767388  1.01560199  -1.33575163 -1.1798594716     setosa
#> 19   -0.17309407  1.70388647  -1.16580868 -1.1798594716     setosa
#> 20   -0.89767388  1.70388647  -1.27910398 -1.1798594716     setosa
#> 21   -0.53538397  0.78617383  -1.16580868 -1.3110521482     setosa
#> 22   -0.89767388  1.47445831  -1.27910398 -1.0486667950     setosa
#> 23   -1.50149039  1.24503015  -1.56234224 -1.3110521482     setosa
#> 24   -0.89767388  0.55674567  -1.16580868 -0.9174741184     setosa
#> 25   -1.25996379  0.78617383  -1.05251337 -1.3110521482     setosa
#> 26   -1.01843718 -0.13153881  -1.22245633 -1.3110521482     setosa
#> 27   -1.01843718  0.78617383  -1.22245633 -1.0486667950     setosa
#> 28   -0.77691058  1.01560199  -1.27910398 -1.3110521482     setosa
#> 29   -0.77691058  0.78617383  -1.33575163 -1.3110521482     setosa
#> 30   -1.38072709  0.32731751  -1.22245633 -1.3110521482     setosa
#> 31   -1.25996379  0.09788935  -1.22245633 -1.3110521482     setosa
#> 32   -0.53538397  0.78617383  -1.27910398 -1.0486667950     setosa
#> 33   -0.77691058  2.39217095  -1.27910398 -1.4422448248     setosa
#> 34   -0.41462067  2.62159911  -1.33575163 -1.3110521482     setosa
#> 35   -1.13920048  0.09788935  -1.27910398 -1.3110521482     setosa
#> 36   -1.01843718  0.32731751  -1.44904694 -1.3110521482     setosa
#> 37   -0.41462067  1.01560199  -1.39239929 -1.3110521482     setosa
#> 38   -1.13920048  1.24503015  -1.33575163 -1.4422448248     setosa
#> 39   -1.74301699 -0.13153881  -1.39239929 -1.3110521482     setosa
#> 40   -0.89767388  0.78617383  -1.27910398 -1.3110521482     setosa
#> 41   -1.01843718  1.01560199  -1.39239929 -1.1798594716     setosa
#> 42   -1.62225369 -1.73753594  -1.39239929 -1.1798594716     setosa
#> 43   -1.74301699  0.32731751  -1.39239929 -1.3110521482     setosa
#> 44   -1.01843718  1.01560199  -1.22245633 -0.7862814418     setosa
#> 45   -0.89767388  1.70388647  -1.05251337 -1.0486667950     setosa
#> 46   -1.25996379 -0.13153881  -1.33575163 -1.1798594716     setosa
#> 47   -0.89767388  1.70388647  -1.22245633 -1.3110521482     setosa
#> 48   -1.50149039  0.32731751  -1.33575163 -1.3110521482     setosa
#> 49   -0.65614727  1.47445831  -1.27910398 -1.3110521482     setosa
#> 50   -1.01843718  0.55674567  -1.33575163 -1.3110521482     setosa
#> 51    1.39682886  0.32731751   0.53362088  0.2632599711 versicolor
#> 52    0.67224905  0.32731751   0.42032558  0.3944526477 versicolor
#> 53    1.27606556  0.09788935   0.64691619  0.3944526477 versicolor
#> 54   -0.41462067 -1.73753594   0.13708732  0.1320672944 versicolor
#> 55    0.79301235 -0.59039513   0.47697323  0.3944526477 versicolor
#> 56   -0.17309407 -0.59039513   0.42032558  0.1320672944 versicolor
#> 57    0.55148575  0.55674567   0.53362088  0.5256453243 versicolor
#> 58   -1.13920048 -1.50810778  -0.25944625 -0.2615107354 versicolor
#> 59    0.91377565 -0.36096697   0.47697323  0.1320672944 versicolor
#> 60   -0.77691058 -0.81982329   0.08043967  0.2632599711 versicolor
#> 61   -1.01843718 -2.42582042  -0.14615094 -0.2615107354 versicolor
#> 62    0.06843254 -0.13153881   0.25038262  0.3944526477 versicolor
#> 63    0.18919584 -1.96696410   0.13708732 -0.2615107354 versicolor
#> 64    0.30995914 -0.36096697   0.53362088  0.2632599711 versicolor
#> 65   -0.29385737 -0.36096697  -0.08950329  0.1320672944 versicolor
#> 66    1.03453895  0.09788935   0.36367793  0.2632599711 versicolor
#> 67   -0.29385737 -0.13153881   0.42032558  0.3944526477 versicolor
#> 68   -0.05233076 -0.81982329   0.19373497 -0.2615107354 versicolor
#> 69    0.43072244 -1.96696410   0.42032558  0.3944526477 versicolor
#> 70   -0.29385737 -1.27867961   0.08043967 -0.1303180588 versicolor
#> 71    0.06843254  0.32731751   0.59026853  0.7880306775 versicolor
#> 72    0.30995914 -0.59039513   0.13708732  0.1320672944 versicolor
#> 73    0.55148575 -1.27867961   0.64691619  0.3944526477 versicolor
#> 74    0.30995914 -0.59039513   0.53362088  0.0008746178 versicolor
#> 75    0.67224905 -0.36096697   0.30703027  0.1320672944 versicolor
#> 76    0.91377565 -0.13153881   0.36367793  0.2632599711 versicolor
#> 77    1.15530226 -0.59039513   0.59026853  0.2632599711 versicolor
#> 78    1.03453895 -0.13153881   0.70356384  0.6568380009 versicolor
#> 79    0.18919584 -0.36096697   0.42032558  0.3944526477 versicolor
#> 80   -0.17309407 -1.04925145  -0.14615094 -0.2615107354 versicolor
#> 81   -0.41462067 -1.50810778   0.02379201 -0.1303180588 versicolor
#> 82   -0.41462067 -1.50810778  -0.03285564 -0.2615107354 versicolor
#> 83   -0.05233076 -0.81982329   0.08043967  0.0008746178 versicolor
#> 84    0.18919584 -0.81982329   0.76021149  0.5256453243 versicolor
#> 85   -0.53538397 -0.13153881   0.42032558  0.3944526477 versicolor
#> 86    0.18919584  0.78617383   0.42032558  0.5256453243 versicolor
#> 87    1.03453895  0.09788935   0.53362088  0.3944526477 versicolor
#> 88    0.55148575 -1.73753594   0.36367793  0.1320672944 versicolor
#> 89   -0.29385737 -0.13153881   0.19373497  0.1320672944 versicolor
#> 90   -0.41462067 -1.27867961   0.13708732  0.1320672944 versicolor
#> 91   -0.41462067 -1.04925145   0.36367793  0.0008746178 versicolor
#> 92    0.30995914 -0.13153881   0.47697323  0.2632599711 versicolor
#> 93   -0.05233076 -1.04925145   0.13708732  0.0008746178 versicolor
#> 94   -1.01843718 -1.73753594  -0.25944625 -0.2615107354 versicolor
#> 95   -0.29385737 -0.81982329   0.25038262  0.1320672944 versicolor
#> 96   -0.17309407 -0.13153881   0.25038262  0.0008746178 versicolor
#> 97   -0.17309407 -0.36096697   0.25038262  0.1320672944 versicolor
#> 98    0.43072244 -0.36096697   0.30703027  0.1320672944 versicolor
#> 99   -0.89767388 -1.27867961  -0.42938920 -0.1303180588 versicolor
#> 100  -0.17309407 -0.59039513   0.19373497  0.1320672944 versicolor
#> 101   0.55148575  0.55674567   1.27004036  1.7063794137  virginica
#> 102  -0.05233076 -0.81982329   0.76021149  0.9192233541  virginica
#> 103   1.51759216 -0.13153881   1.21339271  1.1816087073  virginica
#> 104   0.55148575 -0.36096697   1.04344975  0.7880306775  virginica
#> 105   0.79301235 -0.13153881   1.15674505  1.3128013839  virginica
#> 106   2.12140867 -0.13153881   1.60992627  1.1816087073  virginica
#> 107  -1.13920048 -1.27867961   0.42032558  0.6568380009  virginica
#> 108   1.75911877 -0.36096697   1.43998331  0.7880306775  virginica
#> 109   1.03453895 -1.27867961   1.15674505  0.7880306775  virginica
#> 110   1.63835547  1.24503015   1.32668801  1.7063794137  virginica
#> 111   0.79301235  0.32731751   0.76021149  1.0504160307  virginica
#> 112   0.67224905 -0.81982329   0.87350679  0.9192233541  virginica
#> 113   1.15530226 -0.13153881   0.98680210  1.1816087073  virginica
#> 114  -0.17309407 -1.27867961   0.70356384  1.0504160307  virginica
#> 115  -0.05233076 -0.59039513   0.76021149  1.5751867371  virginica
#> 116   0.67224905  0.32731751   0.87350679  1.4439940605  virginica
#> 117   0.79301235 -0.13153881   0.98680210  0.7880306775  virginica
#> 118   2.24217198  1.70388647   1.66657392  1.3128013839  virginica
#> 119   2.24217198 -1.04925145   1.77986923  1.4439940605  virginica
#> 120   0.18919584 -1.96696410   0.70356384  0.3944526477  virginica
#> 121   1.27606556  0.32731751   1.10009740  1.4439940605  virginica
#> 122  -0.29385737 -0.59039513   0.64691619  1.0504160307  virginica
#> 123   2.24217198 -0.59039513   1.66657392  1.0504160307  virginica
#> 124   0.55148575 -0.81982329   0.64691619  0.7880306775  virginica
#> 125   1.03453895  0.55674567   1.10009740  1.1816087073  virginica
#> 126   1.63835547  0.32731751   1.27004036  0.7880306775  virginica
#> 127   0.43072244 -0.59039513   0.59026853  0.7880306775  virginica
#> 128   0.30995914 -0.13153881   0.64691619  0.7880306775  virginica
#> 129   0.67224905 -0.59039513   1.04344975  1.1816087073  virginica
#> 130   1.63835547 -0.13153881   1.15674505  0.5256453243  virginica
#> 131   1.87988207 -0.59039513   1.32668801  0.9192233541  virginica
#> 132   2.48369858  1.70388647   1.49663097  1.0504160307  virginica
#> 133   0.67224905 -0.59039513   1.04344975  1.3128013839  virginica
#> 134   0.55148575 -0.59039513   0.76021149  0.3944526477  virginica
#> 135   0.30995914 -1.04925145   1.04344975  0.2632599711  virginica
#> 136   2.24217198 -0.13153881   1.32668801  1.4439940605  virginica
#> 137   0.55148575  0.78617383   1.04344975  1.5751867371  virginica
#> 138   0.67224905  0.09788935   0.98680210  0.7880306775  virginica
#> 139   0.18919584 -0.13153881   0.59026853  0.7880306775  virginica
#> 140   1.27606556  0.09788935   0.93015445  1.1816087073  virginica
#> 141   1.03453895  0.09788935   1.04344975  1.5751867371  virginica
#> 142   1.27606556  0.09788935   0.76021149  1.4439940605  virginica
#> 143  -0.05233076 -0.81982329   0.76021149  0.9192233541  virginica
#> 144   1.15530226  0.32731751   1.21339271  1.4439940605  virginica
#> 145   1.03453895  0.55674567   1.10009740  1.7063794137  virginica
#> 146   1.03453895 -0.13153881   0.81685914  1.4439940605  virginica
#> 147   0.55148575 -1.27867961   0.70356384  0.9192233541  virginica
#> 148   0.79301235 -0.13153881   0.81685914  1.0504160307  virginica
#> 149   0.43072244  0.78617383   0.93015445  1.4439940605  virginica
#> 150   0.06843254 -0.13153881   0.76021149  0.7880306775  virginica
#> 

## Not combine list of dataframes to one dataframe e.g. as:
a <- scale_by(iris, ~Species)
d <- do.call(rbind, a)