[!] Calculate ratios between values of every column pair.

colRatios(x, col.names = c("full", "short", "rm.letters"))

Arguments

x

A matrix-like data.

col.names

One of the fpollowing: c("full", "short", "rm.letters").

[NOT UPDATED DESCRIPTION] If FALSE, whole names of compared columns will be used for column of ratios, e.g. "Column 1/ Column 2". If TRUE (default), shorter version of column name will be used, where parts of name which are common for both columns will not be repeated, e.g. "Column 1/2".

Value

A matrix with ratios between values of every column pair of the matrix x.

Examples

x <- Scores2[[]]
r1 <- colRatios(x)
r2 <- colRatios(x, col.names = "short")
r3 <- colRatios(x, col.names = "rm.letters")

head(x)
#>       k_308nm   k_419nm   k_421nm  k_495nm   k_582nm
#> [1,] 69.77013 120.10354 101.35436 204.9295 175.36587
#> [2,] 77.30866  91.98842  95.00618 127.0813 142.84748
#> [3,] 88.75862 105.70442  93.96907 179.0819 121.24322
#> [4,] 65.99990 104.22018  88.85401 158.5893 111.35109
#> [5,] 81.66519 102.62386  88.14868 169.4424 150.80227
#> [6,] 70.47904 100.61981  94.28461 162.3192  62.70744
head(r1)
#>      k_308nm / k_419nm k_308nm / k_421nm k_308nm / k_495nm k_308nm / k_582nm
#> [1,]         0.5809165         0.6883782         0.3404592         0.3978547
#> [2,]         0.8404173         0.8137224         0.6083403         0.5411972
#> [3,]         0.8396870         0.9445515         0.4956315         0.7320708
#> [4,]         0.6332737         0.7427903         0.4161688         0.5927189
#> [5,]         0.7957719         0.9264482         0.4819642         0.5415382
#> [6,]         0.7004489         0.7475138         0.4342003         1.1239343
#>      k_419nm / k_421nm k_419nm / k_495nm k_419nm / k_582nm k_421nm / k_495nm
#> [1,]         1.1849864         0.5860726         0.6848741         0.4945817
#> [2,]         0.9682362         0.7238550         0.6439625         0.7476018
#> [3,]         1.1248852         0.5902575         0.8718378         0.5247269
#> [4,]         1.1729372         0.6571705         0.9359601         0.5602776
#> [5,]         1.1642133         0.6056562         0.6805194         0.5202279
#> [6,]         1.0671924         0.6198886         1.6045913         0.5808593
#>      k_421nm / k_582nm k_495nm / k_582nm
#> [1,]         0.5779594          1.168582
#> [2,]         0.6650882          0.889629
#> [3,]         0.7750460          1.477046
#> [4,]         0.7979626          1.424227
#> [5,]         0.5845315          1.123607
#> [6,]         1.5035634          2.588516

colnames(r1)
#>  [1] "k_308nm / k_419nm" "k_308nm / k_421nm" "k_308nm / k_495nm"
#>  [4] "k_308nm / k_582nm" "k_419nm / k_421nm" "k_419nm / k_495nm"
#>  [7] "k_419nm / k_582nm" "k_421nm / k_495nm" "k_421nm / k_582nm"
#> [10] "k_495nm / k_582nm"
colnames(r2)
#>  [1] "k_308 / 419nm" "k_308 / 421nm" "k_308 / 495nm" "k_308 / 582nm"
#>  [5] "k_419 / 21nm"  "k_419 / 95nm"  "k_419 / 582nm" "k_421 / 95nm" 
#>  [9] "k_421 / 582nm" "k_495 / 582nm"
colnames(r3)
#>  [1] "_308 / _419" "_308 / _421" "_308 / _495" "_308 / _582" "_419 / _421"
#>  [6] "_419 / _495" "_419 / _582" "_421 / _495" "_421 / _582" "_495 / _582"