R Under development (unstable) (2024-01-24 r85824 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > options(warn=1) > # ad-hod function for comparing numbers > qround <- function(x) round(x, dig=3) > > library("compositions") Welcome to compositions, a package for compositional data analysis. Find an intro with "? compositions" Attaching package: 'compositions' The following objects are masked from 'package:stats': anova, cor, cov, dist, var The following object is masked from 'package:graphics': segments The following objects are masked from 'package:base': %*%, norm, scale, scale.default > > #js <- read.table("juraset.dat",skip=17,header=TRUE) > #js$Land <- factor( c("Wald","Weide","Wiese","Acker")[js$Land] ) > #js$Rock <- factor( c("Argovian","Kimmeridgian","Sequanian","Portlandian","Quaternary")[js$Rock] ) > > #Rock <- js$Rock > #Land <- js$Land > > #cdata <- js[,c("Cd","Cu","Pb","Co","Cr","Ni","Zn")] > #cdata <- data.matrix(js[,c("Cd","Cu","Pb","Co","Cr","Ni","Zn")]) > > #cd1 <- cdata[,1:3] > #cd2 <- cdata[,4:7] > data(SimulatedAmounts) > cdata <- sa.groups5 > Land <- sa.groups5.area > cd1 <- cdata[,1:3] > cd2 <- cdata[,4:5] > > # Transformations > # clo > clo(c(1,2,3)) [1] 0.1666667 0.3333333 0.5000000 > clo(matrix(1:4,ncol=2)) [,1] [,2] [1,] 0.2500000 0.7500000 [2,] 0.3333333 0.6666667 > data(iris) > clo(iris[1:10,1:4]) Sepal.Length Sepal.Width Petal.Length Petal.Width 1 0.5000000 0.3431373 0.1372549 0.01960784 2 0.5157895 0.3157895 0.1473684 0.02105263 3 0.5000000 0.3404255 0.1382979 0.02127660 4 0.4893617 0.3297872 0.1595745 0.02127660 5 0.4901961 0.3529412 0.1372549 0.01960784 6 0.4736842 0.3421053 0.1491228 0.03508772 7 0.4742268 0.3505155 0.1443299 0.03092784 8 0.4950495 0.3366337 0.1485149 0.01980198 9 0.4943820 0.3258427 0.1573034 0.02247191 10 0.5104167 0.3229167 0.1562500 0.01041667 > clo(0.5) [1] 1 > clo(matrix(0.5)) [,1] [1,] 1 > clo(matrix(0.5,nrow=5)) [,1] [1,] 1 [2,] 1 [3,] 1 [4,] 1 [5,] 1 > clo(matrix(0.5,ncol=5)) [,1] [,2] [,3] [,4] [,5] [1,] 0.2 0.2 0.2 0.2 0.2 > > clo(iris[1:10,],c("Sepal.Length","Petal.Length")) Sepal.Length Petal.Length 1 0.7846154 0.2153846 2 0.7777778 0.2222222 3 0.7833333 0.2166667 4 0.7540984 0.2459016 5 0.7812500 0.2187500 6 0.7605634 0.2394366 7 0.7666667 0.2333333 8 0.7692308 0.2307692 9 0.7586207 0.2413793 10 0.7656250 0.2343750 > clo(iris[1:10,],c(2,3)) Sepal.Width Petal.Length 1 0.7142857 0.2857143 2 0.6818182 0.3181818 3 0.7111111 0.2888889 4 0.6739130 0.3260870 5 0.7200000 0.2800000 6 0.6964286 0.3035714 7 0.7083333 0.2916667 8 0.6938776 0.3061224 9 0.6744186 0.3255814 10 0.6739130 0.3260870 > > checker <- function(x,y) { + x<-unclass(x) + y<-unclass(y) + if( sum(c(x-y)^2) > 1E-10 ) + stop("Wrong results in ", deparse(substitute(x))) + x + } > > qround( clr(cdata[1:10,]) ) Cu Zn Pb Cd Co [1,] -0.651 -0.302 2.898 -1.553 -0.392 [2,] -3.080 -0.479 2.399 -0.160 1.320 [3,] 0.542 2.465 4.541 -4.407 -3.141 [4,] 0.358 1.240 3.620 -3.054 -2.164 [5,] 1.401 2.131 4.767 -4.394 -3.905 [6,] 1.183 1.514 3.289 -3.493 -2.493 [7,] 0.547 2.110 3.331 -3.312 -2.676 [8,] -0.515 1.642 3.518 -2.653 -1.992 [9,] 0.482 1.780 4.113 -3.357 -3.017 [10,] -0.210 1.163 2.568 -2.466 -1.054 attr(,"class") [1] "rmult" > > qround( checker( clrInv(clr(cdata)) , clo(cdata) ) ) Cu Zn Pb Cd Co [1,] 0.026 0.036 0.894 0.010 0.033 [2,] 0.003 0.038 0.677 0.052 0.230 [3,] 0.016 0.110 0.874 0.000 0.000 [4,] 0.034 0.082 0.881 0.001 0.003 [5,] 0.031 0.065 0.904 0.000 0.000 [6,] 0.094 0.131 0.772 0.001 0.002 [7,] 0.045 0.217 0.735 0.001 0.002 [8,] 0.015 0.130 0.850 0.002 0.003 [9,] 0.024 0.086 0.889 0.001 0.001 [10,] 0.046 0.183 0.746 0.005 0.020 [11,] 0.030 0.121 0.848 0.000 0.000 [12,] 0.005 0.011 0.981 0.001 0.002 [13,] 0.007 0.018 0.975 0.000 0.000 [14,] 0.015 0.066 0.919 0.000 0.000 [15,] 0.026 0.046 0.925 0.001 0.003 [16,] 0.296 0.316 0.293 0.036 0.059 [17,] 0.075 0.117 0.663 0.035 0.110 [18,] 0.043 0.073 0.879 0.001 0.004 [19,] 0.039 0.107 0.844 0.003 0.007 [20,] 0.170 0.412 0.319 0.040 0.060 [21,] 0.346 0.599 0.054 0.001 0.000 [22,] 0.104 0.203 0.691 0.001 0.001 [23,] 0.403 0.574 0.022 0.001 0.000 [24,] 0.277 0.566 0.152 0.004 0.001 [25,] 0.254 0.649 0.071 0.022 0.004 [26,] 0.238 0.581 0.179 0.001 0.001 [27,] 0.214 0.736 0.045 0.003 0.001 [28,] 0.073 0.289 0.628 0.008 0.002 [29,] 0.193 0.325 0.481 0.000 0.000 [30,] 0.137 0.493 0.126 0.196 0.047 [31,] 0.111 0.860 0.027 0.002 0.001 [32,] 0.276 0.478 0.200 0.034 0.012 [33,] 0.017 0.104 0.875 0.003 0.001 [34,] 0.030 0.536 0.433 0.000 0.000 [35,] 0.179 0.599 0.221 0.001 0.000 [36,] 0.190 0.322 0.472 0.010 0.005 [37,] 0.114 0.497 0.385 0.003 0.002 [38,] 0.166 0.118 0.717 0.000 0.000 [39,] 0.198 0.636 0.166 0.000 0.000 [40,] 0.134 0.258 0.558 0.031 0.018 [41,] 0.180 0.803 0.013 0.004 0.000 [42,] 0.050 0.948 0.002 0.000 0.000 [43,] 0.098 0.780 0.118 0.003 0.001 [44,] 0.052 0.311 0.013 0.549 0.075 [45,] 0.043 0.940 0.002 0.014 0.002 [46,] 0.046 0.946 0.007 0.001 0.000 [47,] 0.071 0.868 0.015 0.039 0.007 [48,] 0.027 0.544 0.009 0.355 0.066 [49,] 0.039 0.940 0.008 0.012 0.002 [50,] 0.133 0.867 0.000 0.000 0.000 [51,] 0.080 0.802 0.013 0.089 0.016 [52,] 0.047 0.950 0.001 0.002 0.000 [53,] 0.102 0.892 0.006 0.000 0.000 [54,] 0.157 0.827 0.006 0.008 0.002 [55,] 0.072 0.447 0.008 0.413 0.060 [56,] 0.115 0.874 0.000 0.010 0.001 [57,] 0.081 0.918 0.001 0.000 0.000 [58,] 0.033 0.955 0.012 0.000 0.000 [59,] 0.041 0.925 0.006 0.024 0.004 [60,] 0.025 0.914 0.001 0.052 0.008 > qround( ilr(cdata) ) [,1] [,2] [,3] [,4] [1,] 0.247 2.755 -1.906 -0.439 [2,] 1.839 3.412 0.196 1.476 [3,] 1.360 2.481 -5.996 -3.512 [4,] 0.624 2.303 -4.151 -2.420 [5,] 0.516 2.450 -6.201 -4.366 [6,] 0.234 1.584 -4.753 -2.787 [7,] 1.105 1.635 -4.597 -2.992 [8,] 1.525 2.412 -3.639 -2.227 [9,] 0.918 2.435 -4.748 -3.373 [10,] 0.971 1.708 -3.152 -1.179 [11,] 0.977 2.154 -7.311 -4.225 [12,] 0.625 4.004 -3.301 -1.624 [13,] 0.622 3.636 -6.164 -4.040 [14,] 1.032 2.751 -6.522 -3.932 [15,] 0.410 2.692 -3.857 -2.187 [16,] 0.046 -0.036 -1.845 -0.986 [17,] 0.312 1.598 -1.412 -0.074 [18,] 0.386 2.250 -4.439 -2.021 [19,] 0.716 2.099 -3.408 -1.884 [20,] 0.626 0.154 -1.699 -0.948 [21,] 0.387 -1.734 -5.066 -5.007 [22,] 0.473 1.275 -4.441 -3.975 [23,] 0.249 -2.515 -4.690 -4.398 [24,] 0.504 -0.781 -3.777 -3.914 [25,] 0.665 -1.423 -2.024 -3.124 [26,] 0.633 -0.596 -4.799 -4.054 [27,] 0.872 -1.773 -3.483 -4.113 [28,] 0.975 1.195 -2.956 -3.549 [29,] 0.369 0.533 -6.351 -5.830 [30,] 0.905 -0.591 -0.035 -1.308 [31,] 1.448 -2.000 -3.902 -3.125 [32,] 0.389 -0.487 -1.875 -2.356 [33,] 1.278 2.477 -3.110 -3.839 [34,] 2.039 1.002 -5.205 -5.099 [35,] 0.853 -0.323 -5.274 -4.700 [36,] 0.374 0.527 -2.935 -2.856 [37,] 1.040 0.392 -3.970 -3.458 [38,] -0.242 1.337 -7.651 -6.567 [39,] 0.826 -0.620 -5.658 -4.850 [40,] 0.461 0.897 -1.859 -1.923 [41,] 1.057 -2.729 -3.066 -4.217 [42,] 2.076 -3.868 -8.087 -7.543 [43,] 1.465 -0.697 -3.662 -4.122 [44,] 1.261 -1.852 1.918 -0.297 [45,] 2.184 -3.820 -0.974 -2.542 [46,] 2.139 -2.751 -4.180 -4.867 [47,] 1.767 -2.278 -0.796 -2.221 [48,] 2.132 -2.163 1.701 -0.184 [49,] 2.253 -2.592 -1.512 -2.969 [50,] 1.328 -5.945 -5.385 -6.239 [51,] 1.635 -2.393 -0.062 -1.572 [52,] 2.124 -4.523 -2.476 -4.080 [53,] 1.537 -3.240 -4.700 -4.931 [54,] 1.173 -3.359 -2.077 -3.131 [55,] 1.294 -2.529 1.618 -0.476 [56,] 1.433 -5.471 -1.090 -2.894 [57,] 1.716 -4.756 -5.601 -6.089 [58,] 2.373 -2.213 -5.510 -6.509 [59,] 2.201 -2.876 -0.787 -2.284 [60,] 2.537 -4.381 0.619 -1.208 attr(,"class") [1] "rmult" > qround( checker( ilrInv(ilr(cdata)) , clo(cdata) ) ) Cu Zn Pb Cd Co [1,] 0.026 0.036 0.894 0.010 0.033 [2,] 0.003 0.038 0.677 0.052 0.230 [3,] 0.016 0.110 0.874 0.000 0.000 [4,] 0.034 0.082 0.881 0.001 0.003 [5,] 0.031 0.065 0.904 0.000 0.000 [6,] 0.094 0.131 0.772 0.001 0.002 [7,] 0.045 0.217 0.735 0.001 0.002 [8,] 0.015 0.130 0.850 0.002 0.003 [9,] 0.024 0.086 0.889 0.001 0.001 [10,] 0.046 0.183 0.746 0.005 0.020 [11,] 0.030 0.121 0.848 0.000 0.000 [12,] 0.005 0.011 0.981 0.001 0.002 [13,] 0.007 0.018 0.975 0.000 0.000 [14,] 0.015 0.066 0.919 0.000 0.000 [15,] 0.026 0.046 0.925 0.001 0.003 [16,] 0.296 0.316 0.293 0.036 0.059 [17,] 0.075 0.117 0.663 0.035 0.110 [18,] 0.043 0.073 0.879 0.001 0.004 [19,] 0.039 0.107 0.844 0.003 0.007 [20,] 0.170 0.412 0.319 0.040 0.060 [21,] 0.346 0.599 0.054 0.001 0.000 [22,] 0.104 0.203 0.691 0.001 0.001 [23,] 0.403 0.574 0.022 0.001 0.000 [24,] 0.277 0.566 0.152 0.004 0.001 [25,] 0.254 0.649 0.071 0.022 0.004 [26,] 0.238 0.581 0.179 0.001 0.001 [27,] 0.214 0.736 0.045 0.003 0.001 [28,] 0.073 0.289 0.628 0.008 0.002 [29,] 0.193 0.325 0.481 0.000 0.000 [30,] 0.137 0.493 0.126 0.196 0.047 [31,] 0.111 0.860 0.027 0.002 0.001 [32,] 0.276 0.478 0.200 0.034 0.012 [33,] 0.017 0.104 0.875 0.003 0.001 [34,] 0.030 0.536 0.433 0.000 0.000 [35,] 0.179 0.599 0.221 0.001 0.000 [36,] 0.190 0.322 0.472 0.010 0.005 [37,] 0.114 0.497 0.385 0.003 0.002 [38,] 0.166 0.118 0.717 0.000 0.000 [39,] 0.198 0.636 0.166 0.000 0.000 [40,] 0.134 0.258 0.558 0.031 0.018 [41,] 0.180 0.803 0.013 0.004 0.000 [42,] 0.050 0.948 0.002 0.000 0.000 [43,] 0.098 0.780 0.118 0.003 0.001 [44,] 0.052 0.311 0.013 0.549 0.075 [45,] 0.043 0.940 0.002 0.014 0.002 [46,] 0.046 0.946 0.007 0.001 0.000 [47,] 0.071 0.868 0.015 0.039 0.007 [48,] 0.027 0.544 0.009 0.355 0.066 [49,] 0.039 0.940 0.008 0.012 0.002 [50,] 0.133 0.867 0.000 0.000 0.000 [51,] 0.080 0.802 0.013 0.089 0.016 [52,] 0.047 0.950 0.001 0.002 0.000 [53,] 0.102 0.892 0.006 0.000 0.000 [54,] 0.157 0.827 0.006 0.008 0.002 [55,] 0.072 0.447 0.008 0.413 0.060 [56,] 0.115 0.874 0.000 0.010 0.001 [57,] 0.081 0.918 0.001 0.000 0.000 [58,] 0.033 0.955 0.012 0.000 0.000 [59,] 0.041 0.925 0.006 0.024 0.004 [60,] 0.025 0.914 0.001 0.052 0.008 > qround( alr(cdata) ) Cu Zn Pb Cd [1,] -0.259 0.090 3.290 -1.160 [2,] -4.400 -1.799 1.079 -1.481 [3,] 3.683 5.606 7.682 -1.266 [4,] 2.522 3.404 5.784 -0.889 [5,] 5.306 6.036 8.672 -0.489 [6,] 3.675 4.007 5.781 -1.000 [7,] 3.223 4.786 6.008 -0.636 [8,] 1.477 3.634 5.510 -0.661 [9,] 3.498 4.796 7.129 -0.341 [10,] 0.845 2.217 3.623 -1.412 [11,] 5.264 6.645 8.593 -1.608 [12,] 0.692 1.575 6.038 -1.044 [13,] 4.373 5.252 9.266 -0.821 [14,] 4.426 5.885 8.525 -1.253 [15,] 2.170 2.749 5.757 -0.894 [16,] 1.618 1.682 1.605 -0.495 [17,] -0.382 0.059 1.795 -1.139 [18,] 2.349 2.896 5.379 -1.584 [19,] 1.727 2.741 4.804 -0.845 [20,] 1.045 1.930 1.676 -0.411 [21,] 7.494 8.042 5.644 1.210 [22,] 4.871 5.540 6.767 0.598 [23,] 7.121 7.474 4.217 0.856 [24,] 5.428 6.141 4.828 1.105 [25,] 4.188 5.127 2.915 1.740 [26,] 5.715 6.609 5.431 0.377 [27,] 5.711 6.945 4.157 1.582 [28,] 3.645 5.023 5.797 1.409 [29,] 7.873 8.395 8.787 1.019 [30,] 1.074 2.354 0.990 1.432 [31,] 4.413 6.461 2.988 0.115 [32,] 3.099 3.650 2.778 1.011 [33,] 3.274 5.082 7.212 1.599 [34,] 5.353 8.236 8.022 1.193 [35,] 6.307 7.512 6.514 0.688 [36,] 3.561 4.090 4.471 0.652 [37,] 4.118 5.588 5.332 0.429 [38,] 9.176 8.834 10.642 0.716 [39,] 6.725 7.893 6.549 0.522 [40,] 1.995 2.646 3.419 0.540 [41,] 5.966 7.461 3.371 2.059 [42,] 10.879 13.815 7.610 1.430 [43,] 4.914 6.986 5.096 1.437 [44,] -0.357 1.425 -1.734 1.993 [45,] 3.139 6.227 0.004 1.999 [46,] 6.259 9.283 4.401 1.821 [47,] 2.394 4.892 0.853 1.794 [48,] -0.910 2.106 -2.051 1.679 [49,] 3.222 6.407 1.640 2.010 [50,] 10.018 11.896 3.676 2.312 [51,] 1.596 3.908 -0.179 1.704 [52,] 5.620 8.624 1.583 2.417 [53,] 7.105 9.279 4.224 1.442 [54,] 4.643 6.301 1.357 1.702 [55,] 0.182 2.012 -2.000 1.933 [56,] 4.771 6.797 -0.917 2.292 [57,] 9.153 11.579 4.541 1.957 [58,] 8.094 11.450 7.061 2.505 [59,] 2.399 5.511 0.432 1.872 [60,] 1.166 4.754 -2.406 1.887 attr(,"class") [1] "rmult" > qround( checker( alrInv(alr(cdata)) , clo(cdata) ) ) Cu Zn Pb Cd Co [1,] 0.026 0.036 0.894 0.010 0.033 [2,] 0.003 0.038 0.677 0.052 0.230 [3,] 0.016 0.110 0.874 0.000 0.000 [4,] 0.034 0.082 0.881 0.001 0.003 [5,] 0.031 0.065 0.904 0.000 0.000 [6,] 0.094 0.131 0.772 0.001 0.002 [7,] 0.045 0.217 0.735 0.001 0.002 [8,] 0.015 0.130 0.850 0.002 0.003 [9,] 0.024 0.086 0.889 0.001 0.001 [10,] 0.046 0.183 0.746 0.005 0.020 [11,] 0.030 0.121 0.848 0.000 0.000 [12,] 0.005 0.011 0.981 0.001 0.002 [13,] 0.007 0.018 0.975 0.000 0.000 [14,] 0.015 0.066 0.919 0.000 0.000 [15,] 0.026 0.046 0.925 0.001 0.003 [16,] 0.296 0.316 0.293 0.036 0.059 [17,] 0.075 0.117 0.663 0.035 0.110 [18,] 0.043 0.073 0.879 0.001 0.004 [19,] 0.039 0.107 0.844 0.003 0.007 [20,] 0.170 0.412 0.319 0.040 0.060 [21,] 0.346 0.599 0.054 0.001 0.000 [22,] 0.104 0.203 0.691 0.001 0.001 [23,] 0.403 0.574 0.022 0.001 0.000 [24,] 0.277 0.566 0.152 0.004 0.001 [25,] 0.254 0.649 0.071 0.022 0.004 [26,] 0.238 0.581 0.179 0.001 0.001 [27,] 0.214 0.736 0.045 0.003 0.001 [28,] 0.073 0.289 0.628 0.008 0.002 [29,] 0.193 0.325 0.481 0.000 0.000 [30,] 0.137 0.493 0.126 0.196 0.047 [31,] 0.111 0.860 0.027 0.002 0.001 [32,] 0.276 0.478 0.200 0.034 0.012 [33,] 0.017 0.104 0.875 0.003 0.001 [34,] 0.030 0.536 0.433 0.000 0.000 [35,] 0.179 0.599 0.221 0.001 0.000 [36,] 0.190 0.322 0.472 0.010 0.005 [37,] 0.114 0.497 0.385 0.003 0.002 [38,] 0.166 0.118 0.717 0.000 0.000 [39,] 0.198 0.636 0.166 0.000 0.000 [40,] 0.134 0.258 0.558 0.031 0.018 [41,] 0.180 0.803 0.013 0.004 0.000 [42,] 0.050 0.948 0.002 0.000 0.000 [43,] 0.098 0.780 0.118 0.003 0.001 [44,] 0.052 0.311 0.013 0.549 0.075 [45,] 0.043 0.940 0.002 0.014 0.002 [46,] 0.046 0.946 0.007 0.001 0.000 [47,] 0.071 0.868 0.015 0.039 0.007 [48,] 0.027 0.544 0.009 0.355 0.066 [49,] 0.039 0.940 0.008 0.012 0.002 [50,] 0.133 0.867 0.000 0.000 0.000 [51,] 0.080 0.802 0.013 0.089 0.016 [52,] 0.047 0.950 0.001 0.002 0.000 [53,] 0.102 0.892 0.006 0.000 0.000 [54,] 0.157 0.827 0.006 0.008 0.002 [55,] 0.072 0.447 0.008 0.413 0.060 [56,] 0.115 0.874 0.000 0.010 0.001 [57,] 0.081 0.918 0.001 0.000 0.000 [58,] 0.033 0.955 0.012 0.000 0.000 [59,] 0.041 0.925 0.006 0.024 0.004 [60,] 0.025 0.914 0.001 0.052 0.008 > qround( cpt(cdata) ) Cu Zn Pb Cd Co [1,] -0.174 -0.164 0.694 -0.190 -0.167 [2,] -0.197 -0.162 0.477 -0.148 0.030 [3,] -0.184 -0.090 0.674 -0.200 -0.200 [4,] -0.166 -0.118 0.681 -0.199 -0.197 [5,] -0.169 -0.135 0.704 -0.200 -0.200 [6,] -0.106 -0.069 0.572 -0.199 -0.198 [7,] -0.155 0.017 0.535 -0.199 -0.198 [8,] -0.185 -0.070 0.650 -0.198 -0.197 [9,] -0.176 -0.114 0.689 -0.199 -0.199 [10,] -0.154 -0.017 0.546 -0.195 -0.180 [11,] -0.170 -0.079 0.648 -0.200 -0.200 [12,] -0.195 -0.189 0.781 -0.199 -0.198 [13,] -0.193 -0.182 0.775 -0.200 -0.200 [14,] -0.185 -0.134 0.719 -0.200 -0.200 [15,] -0.174 -0.154 0.725 -0.199 -0.197 [16,] 0.096 0.116 0.093 -0.164 -0.141 [17,] -0.125 -0.083 0.463 -0.165 -0.090 [18,] -0.157 -0.127 0.679 -0.199 -0.196 [19,] -0.161 -0.093 0.644 -0.197 -0.193 [20,] -0.030 0.212 0.119 -0.160 -0.140 [21,] 0.146 0.399 -0.146 -0.199 -0.200 [22,] -0.096 0.003 0.491 -0.199 -0.199 [23,] 0.203 0.374 -0.178 -0.199 -0.200 [24,] 0.077 0.366 -0.048 -0.196 -0.199 [25,] 0.054 0.449 -0.129 -0.178 -0.196 [26,] 0.038 0.381 -0.021 -0.199 -0.199 [27,] 0.014 0.536 -0.155 -0.197 -0.199 [28,] -0.127 0.089 0.428 -0.192 -0.198 [29,] -0.007 0.125 0.281 -0.200 -0.200 [30,] -0.063 0.293 -0.074 -0.004 -0.153 [31,] -0.089 0.660 -0.173 -0.198 -0.199 [32,] 0.076 0.278 0.000 -0.166 -0.188 [33,] -0.183 -0.096 0.675 -0.197 -0.199 [34,] -0.170 0.336 0.233 -0.200 -0.200 [35,] -0.021 0.399 0.021 -0.199 -0.200 [36,] -0.010 0.122 0.272 -0.190 -0.195 [37,] -0.086 0.297 0.185 -0.197 -0.198 [38,] -0.034 -0.082 0.517 -0.200 -0.200 [39,] -0.002 0.436 -0.034 -0.200 -0.200 [40,] -0.066 0.058 0.358 -0.169 -0.182 [41,] -0.020 0.603 -0.187 -0.196 -0.200 [42,] -0.150 0.748 -0.198 -0.200 -0.200 [43,] -0.102 0.580 -0.082 -0.197 -0.199 [44,] -0.148 0.111 -0.187 0.349 -0.125 [45,] -0.157 0.740 -0.198 -0.186 -0.198 [46,] -0.154 0.746 -0.193 -0.199 -0.200 [47,] -0.129 0.668 -0.185 -0.161 -0.193 [48,] -0.173 0.344 -0.191 0.155 -0.134 [49,] -0.161 0.740 -0.192 -0.188 -0.198 [50,] -0.067 0.667 -0.200 -0.200 -0.200 [51,] -0.120 0.602 -0.187 -0.111 -0.184 [52,] -0.153 0.750 -0.199 -0.198 -0.200 [53,] -0.098 0.692 -0.194 -0.200 -0.200 [54,] -0.043 0.627 -0.194 -0.192 -0.198 [55,] -0.128 0.247 -0.192 0.213 -0.140 [56,] -0.085 0.674 -0.200 -0.190 -0.199 [57,] -0.119 0.718 -0.199 -0.200 -0.200 [58,] -0.167 0.755 -0.188 -0.200 -0.200 [59,] -0.159 0.725 -0.194 -0.176 -0.196 [60,] -0.175 0.714 -0.199 -0.148 -0.192 attr(,"class") [1] "rmult" > qround( checker( cptInv(cpt(cdata)) , clo(cdata) ) ) Cu Zn Pb Cd Co [1,] 0.026 0.036 0.894 0.010 0.033 [2,] 0.003 0.038 0.677 0.052 0.230 [3,] 0.016 0.110 0.874 0.000 0.000 [4,] 0.034 0.082 0.881 0.001 0.003 [5,] 0.031 0.065 0.904 0.000 0.000 [6,] 0.094 0.131 0.772 0.001 0.002 [7,] 0.045 0.217 0.735 0.001 0.002 [8,] 0.015 0.130 0.850 0.002 0.003 [9,] 0.024 0.086 0.889 0.001 0.001 [10,] 0.046 0.183 0.746 0.005 0.020 [11,] 0.030 0.121 0.848 0.000 0.000 [12,] 0.005 0.011 0.981 0.001 0.002 [13,] 0.007 0.018 0.975 0.000 0.000 [14,] 0.015 0.066 0.919 0.000 0.000 [15,] 0.026 0.046 0.925 0.001 0.003 [16,] 0.296 0.316 0.293 0.036 0.059 [17,] 0.075 0.117 0.663 0.035 0.110 [18,] 0.043 0.073 0.879 0.001 0.004 [19,] 0.039 0.107 0.844 0.003 0.007 [20,] 0.170 0.412 0.319 0.040 0.060 [21,] 0.346 0.599 0.054 0.001 0.000 [22,] 0.104 0.203 0.691 0.001 0.001 [23,] 0.403 0.574 0.022 0.001 0.000 [24,] 0.277 0.566 0.152 0.004 0.001 [25,] 0.254 0.649 0.071 0.022 0.004 [26,] 0.238 0.581 0.179 0.001 0.001 [27,] 0.214 0.736 0.045 0.003 0.001 [28,] 0.073 0.289 0.628 0.008 0.002 [29,] 0.193 0.325 0.481 0.000 0.000 [30,] 0.137 0.493 0.126 0.196 0.047 [31,] 0.111 0.860 0.027 0.002 0.001 [32,] 0.276 0.478 0.200 0.034 0.012 [33,] 0.017 0.104 0.875 0.003 0.001 [34,] 0.030 0.536 0.433 0.000 0.000 [35,] 0.179 0.599 0.221 0.001 0.000 [36,] 0.190 0.322 0.472 0.010 0.005 [37,] 0.114 0.497 0.385 0.003 0.002 [38,] 0.166 0.118 0.717 0.000 0.000 [39,] 0.198 0.636 0.166 0.000 0.000 [40,] 0.134 0.258 0.558 0.031 0.018 [41,] 0.180 0.803 0.013 0.004 0.000 [42,] 0.050 0.948 0.002 0.000 0.000 [43,] 0.098 0.780 0.118 0.003 0.001 [44,] 0.052 0.311 0.013 0.549 0.075 [45,] 0.043 0.940 0.002 0.014 0.002 [46,] 0.046 0.946 0.007 0.001 0.000 [47,] 0.071 0.868 0.015 0.039 0.007 [48,] 0.027 0.544 0.009 0.355 0.066 [49,] 0.039 0.940 0.008 0.012 0.002 [50,] 0.133 0.867 0.000 0.000 0.000 [51,] 0.080 0.802 0.013 0.089 0.016 [52,] 0.047 0.950 0.001 0.002 0.000 [53,] 0.102 0.892 0.006 0.000 0.000 [54,] 0.157 0.827 0.006 0.008 0.002 [55,] 0.072 0.447 0.008 0.413 0.060 [56,] 0.115 0.874 0.000 0.010 0.001 [57,] 0.081 0.918 0.001 0.000 0.000 [58,] 0.033 0.955 0.012 0.000 0.000 [59,] 0.041 0.925 0.006 0.024 0.004 [60,] 0.025 0.914 0.001 0.052 0.008 > qround( ipt(cdata) ) [,1] [,2] [,3] [,4] [1,] 0.008 0.705 -0.267 -0.186 [2,] 0.025 0.536 -0.162 0.034 [3,] 0.066 0.662 -0.288 -0.223 [4,] 0.034 0.672 -0.287 -0.221 [5,] 0.024 0.699 -0.289 -0.223 [6,] 0.026 0.538 -0.287 -0.221 [7,] 0.121 0.493 -0.287 -0.222 [8,] 0.081 0.634 -0.286 -0.220 [9,] 0.044 0.681 -0.288 -0.223 [10,] 0.097 0.515 -0.277 -0.201 [11,] 0.064 0.631 -0.289 -0.223 [12,] 0.005 0.794 -0.287 -0.221 [13,] 0.007 0.786 -0.289 -0.224 [14,] 0.036 0.717 -0.289 -0.223 [15,] 0.014 0.726 -0.286 -0.220 [16,] 0.014 -0.011 -0.230 -0.158 [17,] 0.029 0.463 -0.216 -0.101 [18,] 0.022 0.671 -0.287 -0.219 [19,] 0.048 0.629 -0.283 -0.216 [20,] 0.171 0.023 -0.226 -0.157 [21,] 0.179 -0.341 -0.288 -0.223 [22,] 0.070 0.439 -0.287 -0.223 [23,] 0.120 -0.381 -0.288 -0.223 [24,] 0.204 -0.220 -0.284 -0.222 [25,] 0.280 -0.311 -0.262 -0.219 [26,] 0.243 -0.188 -0.287 -0.223 [27,] 0.369 -0.351 -0.284 -0.223 [28,] 0.153 0.365 -0.279 -0.221 [29,] 0.094 0.181 -0.288 -0.224 [30,] 0.252 -0.154 -0.048 -0.171 [31,] 0.529 -0.374 -0.287 -0.222 [32,] 0.143 -0.144 -0.246 -0.210 [33,] 0.061 0.665 -0.285 -0.223 [34,] 0.358 0.122 -0.288 -0.223 [35,] 0.297 -0.138 -0.288 -0.223 [36,] 0.094 0.176 -0.275 -0.218 [37,] 0.270 0.065 -0.285 -0.222 [38,] -0.034 0.470 -0.289 -0.224 [39,] 0.310 -0.205 -0.288 -0.223 [40,] 0.087 0.296 -0.247 -0.203 [41,] 0.440 -0.390 -0.284 -0.223 [42,] 0.635 -0.406 -0.289 -0.224 [43,] 0.482 -0.262 -0.285 -0.223 [44,] 0.183 -0.138 0.367 -0.140 [45,] 0.634 -0.400 -0.272 -0.222 [46,] 0.637 -0.399 -0.288 -0.224 [47,] 0.563 -0.371 -0.242 -0.216 [48,] 0.366 -0.226 0.140 -0.150 [49,] 0.637 -0.393 -0.275 -0.222 [50,] 0.519 -0.408 -0.289 -0.224 [51,] 0.511 -0.349 -0.182 -0.206 [52,] 0.638 -0.406 -0.286 -0.223 [53,] 0.559 -0.401 -0.288 -0.224 [54,] 0.473 -0.397 -0.279 -0.222 [55,] 0.266 -0.205 0.206 -0.157 [56,] 0.536 -0.403 -0.277 -0.223 [57,] 0.592 -0.407 -0.289 -0.224 [58,] 0.652 -0.394 -0.289 -0.224 [59,] 0.625 -0.390 -0.260 -0.219 [60,] 0.628 -0.383 -0.226 -0.215 attr(,"class") [1] "rmult" > qround( checker( iptInv(ipt(cdata)) , clo(cdata) ) ) Cu Zn Pb Cd Co [1,] 0.026 0.036 0.894 0.010 0.033 [2,] 0.003 0.038 0.677 0.052 0.230 [3,] 0.016 0.110 0.874 0.000 0.000 [4,] 0.034 0.082 0.881 0.001 0.003 [5,] 0.031 0.065 0.904 0.000 0.000 [6,] 0.094 0.131 0.772 0.001 0.002 [7,] 0.045 0.217 0.735 0.001 0.002 [8,] 0.015 0.130 0.850 0.002 0.003 [9,] 0.024 0.086 0.889 0.001 0.001 [10,] 0.046 0.183 0.746 0.005 0.020 [11,] 0.030 0.121 0.848 0.000 0.000 [12,] 0.005 0.011 0.981 0.001 0.002 [13,] 0.007 0.018 0.975 0.000 0.000 [14,] 0.015 0.066 0.919 0.000 0.000 [15,] 0.026 0.046 0.925 0.001 0.003 [16,] 0.296 0.316 0.293 0.036 0.059 [17,] 0.075 0.117 0.663 0.035 0.110 [18,] 0.043 0.073 0.879 0.001 0.004 [19,] 0.039 0.107 0.844 0.003 0.007 [20,] 0.170 0.412 0.319 0.040 0.060 [21,] 0.346 0.599 0.054 0.001 0.000 [22,] 0.104 0.203 0.691 0.001 0.001 [23,] 0.403 0.574 0.022 0.001 0.000 [24,] 0.277 0.566 0.152 0.004 0.001 [25,] 0.254 0.649 0.071 0.022 0.004 [26,] 0.238 0.581 0.179 0.001 0.001 [27,] 0.214 0.736 0.045 0.003 0.001 [28,] 0.073 0.289 0.628 0.008 0.002 [29,] 0.193 0.325 0.481 0.000 0.000 [30,] 0.137 0.493 0.126 0.196 0.047 [31,] 0.111 0.860 0.027 0.002 0.001 [32,] 0.276 0.478 0.200 0.034 0.012 [33,] 0.017 0.104 0.875 0.003 0.001 [34,] 0.030 0.536 0.433 0.000 0.000 [35,] 0.179 0.599 0.221 0.001 0.000 [36,] 0.190 0.322 0.472 0.010 0.005 [37,] 0.114 0.497 0.385 0.003 0.002 [38,] 0.166 0.118 0.717 0.000 0.000 [39,] 0.198 0.636 0.166 0.000 0.000 [40,] 0.134 0.258 0.558 0.031 0.018 [41,] 0.180 0.803 0.013 0.004 0.000 [42,] 0.050 0.948 0.002 0.000 0.000 [43,] 0.098 0.780 0.118 0.003 0.001 [44,] 0.052 0.311 0.013 0.549 0.075 [45,] 0.043 0.940 0.002 0.014 0.002 [46,] 0.046 0.946 0.007 0.001 0.000 [47,] 0.071 0.868 0.015 0.039 0.007 [48,] 0.027 0.544 0.009 0.355 0.066 [49,] 0.039 0.940 0.008 0.012 0.002 [50,] 0.133 0.867 0.000 0.000 0.000 [51,] 0.080 0.802 0.013 0.089 0.016 [52,] 0.047 0.950 0.001 0.002 0.000 [53,] 0.102 0.892 0.006 0.000 0.000 [54,] 0.157 0.827 0.006 0.008 0.002 [55,] 0.072 0.447 0.008 0.413 0.060 [56,] 0.115 0.874 0.000 0.010 0.001 [57,] 0.081 0.918 0.001 0.000 0.000 [58,] 0.033 0.955 0.012 0.000 0.000 [59,] 0.041 0.925 0.006 0.024 0.004 [60,] 0.025 0.914 0.001 0.052 0.008 > qround( apt(cdata) ) Cu Zn Pb Cd [1,] 0.026 0.036 0.894 0.010 [2,] 0.003 0.038 0.677 0.052 [3,] 0.016 0.110 0.874 0.000 [4,] 0.034 0.082 0.881 0.001 [5,] 0.031 0.065 0.904 0.000 [6,] 0.094 0.131 0.772 0.001 [7,] 0.045 0.217 0.735 0.001 [8,] 0.015 0.130 0.850 0.002 [9,] 0.024 0.086 0.889 0.001 [10,] 0.046 0.183 0.746 0.005 [11,] 0.030 0.121 0.848 0.000 [12,] 0.005 0.011 0.981 0.001 [13,] 0.007 0.018 0.975 0.000 [14,] 0.015 0.066 0.919 0.000 [15,] 0.026 0.046 0.925 0.001 [16,] 0.296 0.316 0.293 0.036 [17,] 0.075 0.117 0.663 0.035 [18,] 0.043 0.073 0.879 0.001 [19,] 0.039 0.107 0.844 0.003 [20,] 0.170 0.412 0.319 0.040 [21,] 0.346 0.599 0.054 0.001 [22,] 0.104 0.203 0.691 0.001 [23,] 0.403 0.574 0.022 0.001 [24,] 0.277 0.566 0.152 0.004 [25,] 0.254 0.649 0.071 0.022 [26,] 0.238 0.581 0.179 0.001 [27,] 0.214 0.736 0.045 0.003 [28,] 0.073 0.289 0.628 0.008 [29,] 0.193 0.325 0.481 0.000 [30,] 0.137 0.493 0.126 0.196 [31,] 0.111 0.860 0.027 0.002 [32,] 0.276 0.478 0.200 0.034 [33,] 0.017 0.104 0.875 0.003 [34,] 0.030 0.536 0.433 0.000 [35,] 0.179 0.599 0.221 0.001 [36,] 0.190 0.322 0.472 0.010 [37,] 0.114 0.497 0.385 0.003 [38,] 0.166 0.118 0.717 0.000 [39,] 0.198 0.636 0.166 0.000 [40,] 0.134 0.258 0.558 0.031 [41,] 0.180 0.803 0.013 0.004 [42,] 0.050 0.948 0.002 0.000 [43,] 0.098 0.780 0.118 0.003 [44,] 0.052 0.311 0.013 0.549 [45,] 0.043 0.940 0.002 0.014 [46,] 0.046 0.946 0.007 0.001 [47,] 0.071 0.868 0.015 0.039 [48,] 0.027 0.544 0.009 0.355 [49,] 0.039 0.940 0.008 0.012 [50,] 0.133 0.867 0.000 0.000 [51,] 0.080 0.802 0.013 0.089 [52,] 0.047 0.950 0.001 0.002 [53,] 0.102 0.892 0.006 0.000 [54,] 0.157 0.827 0.006 0.008 [55,] 0.072 0.447 0.008 0.413 [56,] 0.115 0.874 0.000 0.010 [57,] 0.081 0.918 0.001 0.000 [58,] 0.033 0.955 0.012 0.000 [59,] 0.041 0.925 0.006 0.024 [60,] 0.025 0.914 0.001 0.052 attr(,"class") [1] "rmult" > qround( checker( aptInv(apt(cdata)) , clo(cdata) ) ) Cu Zn Pb Cd Co [1,] 0.026 0.036 0.894 0.010 0.033 [2,] 0.003 0.038 0.677 0.052 0.230 [3,] 0.016 0.110 0.874 0.000 0.000 [4,] 0.034 0.082 0.881 0.001 0.003 [5,] 0.031 0.065 0.904 0.000 0.000 [6,] 0.094 0.131 0.772 0.001 0.002 [7,] 0.045 0.217 0.735 0.001 0.002 [8,] 0.015 0.130 0.850 0.002 0.003 [9,] 0.024 0.086 0.889 0.001 0.001 [10,] 0.046 0.183 0.746 0.005 0.020 [11,] 0.030 0.121 0.848 0.000 0.000 [12,] 0.005 0.011 0.981 0.001 0.002 [13,] 0.007 0.018 0.975 0.000 0.000 [14,] 0.015 0.066 0.919 0.000 0.000 [15,] 0.026 0.046 0.925 0.001 0.003 [16,] 0.296 0.316 0.293 0.036 0.059 [17,] 0.075 0.117 0.663 0.035 0.110 [18,] 0.043 0.073 0.879 0.001 0.004 [19,] 0.039 0.107 0.844 0.003 0.007 [20,] 0.170 0.412 0.319 0.040 0.060 [21,] 0.346 0.599 0.054 0.001 0.000 [22,] 0.104 0.203 0.691 0.001 0.001 [23,] 0.403 0.574 0.022 0.001 0.000 [24,] 0.277 0.566 0.152 0.004 0.001 [25,] 0.254 0.649 0.071 0.022 0.004 [26,] 0.238 0.581 0.179 0.001 0.001 [27,] 0.214 0.736 0.045 0.003 0.001 [28,] 0.073 0.289 0.628 0.008 0.002 [29,] 0.193 0.325 0.481 0.000 0.000 [30,] 0.137 0.493 0.126 0.196 0.047 [31,] 0.111 0.860 0.027 0.002 0.001 [32,] 0.276 0.478 0.200 0.034 0.012 [33,] 0.017 0.104 0.875 0.003 0.001 [34,] 0.030 0.536 0.433 0.000 0.000 [35,] 0.179 0.599 0.221 0.001 0.000 [36,] 0.190 0.322 0.472 0.010 0.005 [37,] 0.114 0.497 0.385 0.003 0.002 [38,] 0.166 0.118 0.717 0.000 0.000 [39,] 0.198 0.636 0.166 0.000 0.000 [40,] 0.134 0.258 0.558 0.031 0.018 [41,] 0.180 0.803 0.013 0.004 0.000 [42,] 0.050 0.948 0.002 0.000 0.000 [43,] 0.098 0.780 0.118 0.003 0.001 [44,] 0.052 0.311 0.013 0.549 0.075 [45,] 0.043 0.940 0.002 0.014 0.002 [46,] 0.046 0.946 0.007 0.001 0.000 [47,] 0.071 0.868 0.015 0.039 0.007 [48,] 0.027 0.544 0.009 0.355 0.066 [49,] 0.039 0.940 0.008 0.012 0.002 [50,] 0.133 0.867 0.000 0.000 0.000 [51,] 0.080 0.802 0.013 0.089 0.016 [52,] 0.047 0.950 0.001 0.002 0.000 [53,] 0.102 0.892 0.006 0.000 0.000 [54,] 0.157 0.827 0.006 0.008 0.002 [55,] 0.072 0.447 0.008 0.413 0.060 [56,] 0.115 0.874 0.000 0.010 0.001 [57,] 0.081 0.918 0.001 0.000 0.000 [58,] 0.033 0.955 0.012 0.000 0.000 [59,] 0.041 0.925 0.006 0.024 0.004 [60,] 0.025 0.914 0.001 0.052 0.008 > qround( ilt(cdata) ) Cu Zn Pb Cd Co [1,] 0.844 1.193 4.393 -0.058 1.103 [2,] -2.844 -0.243 2.635 0.076 1.556 [3,] -1.191 0.732 2.809 -6.140 -4.873 [4,] 1.065 1.947 4.327 -2.347 -1.457 [5,] 1.749 2.479 5.114 -4.046 -3.557 [6,] 1.131 1.463 3.237 -3.544 -2.544 [7,] 1.084 2.647 3.868 -2.775 -2.139 [8,] 1.119 3.276 5.152 -1.019 -0.358 [9,] 1.126 2.424 4.757 -2.713 -2.372 [10,] 0.731 2.103 3.509 -1.526 -0.114 [11,] 2.080 3.461 5.409 -4.792 -3.184 [12,] -0.234 0.650 5.112 -1.970 -0.926 [13,] -0.250 0.630 4.643 -5.443 -4.622 [14,] -0.877 0.583 3.223 -6.555 -5.302 [15,] 1.163 1.743 4.751 -1.901 -1.006 [16,] 2.095 2.159 2.082 -0.019 0.477 [17,] 1.208 1.649 3.386 0.451 1.591 [18,] 1.361 1.908 4.391 -2.572 -0.988 [19,] 1.065 2.078 4.141 -1.508 -0.663 [20,] 1.881 2.766 2.512 0.425 0.836 [21,] 2.838 3.386 0.988 -3.446 -4.656 [22,] 0.794 1.463 2.690 -3.479 -4.077 [23,] 3.023 3.375 0.118 -3.243 -4.099 [24,] 2.857 3.569 2.257 -1.467 -2.571 [25,] 2.779 3.719 1.507 0.331 -1.408 [26,] 3.126 4.021 2.843 -2.212 -2.589 [27,] 3.160 4.394 1.606 -0.969 -2.551 [28,] 0.606 1.984 2.758 -1.630 -3.039 [29,] 1.981 2.503 2.894 -4.874 -5.892 [30,] 2.032 3.312 1.949 2.391 0.959 [31,] 3.282 5.329 1.856 -1.016 -1.131 [32,] 2.561 3.112 2.241 0.473 -0.538 [33,] -0.209 1.598 3.728 -1.885 -3.484 [34,] 0.630 3.513 3.299 -3.530 -4.723 [35,] 1.515 2.721 1.723 -4.104 -4.791 [36,] 1.604 2.133 2.514 -1.305 -1.957 [37,] 0.793 2.263 2.007 -2.896 -3.325 [38,] 2.816 2.473 4.282 -5.644 -6.361 [39,] 2.673 3.841 2.497 -3.530 -4.052 [40,] 1.298 1.950 2.722 -0.156 -0.696 [41,] 2.394 3.889 -0.201 -1.513 -3.572 [42,] 3.486 6.422 0.216 -5.963 -7.393 [43,] 1.360 3.431 1.542 -2.118 -3.554 [44,] 2.986 4.769 1.610 5.337 3.344 [45,] 2.630 5.718 -0.504 1.490 -0.509 [46,] 2.464 5.489 0.607 -1.974 -3.795 [47,] 1.886 4.385 0.345 1.287 -0.508 [48,] 1.616 4.632 0.475 4.205 2.526 [49,] 1.756 4.942 0.174 0.545 -1.465 [50,] 4.650 6.529 -1.692 -3.056 -5.368 [51,] 1.860 4.171 0.085 1.967 0.263 [52,] 4.107 7.112 0.070 0.904 -1.513 [53,] 4.198 6.372 1.317 -1.464 -2.907 [54,] 2.825 4.483 -0.460 -0.116 -1.818 [55,] 1.836 3.666 -0.346 3.587 1.654 [56,] 4.076 6.102 -1.611 1.597 -0.694 [57,] 3.526 5.952 -1.086 -3.670 -5.627 [58,] 1.321 4.677 0.288 -4.268 -6.773 [59,] 1.970 5.082 0.003 1.443 -0.429 [60,] 3.273 6.861 -0.299 3.993 2.107 attr(,"class") [1] "rmult" > qround( checker( iltInv(ilt(cdata)) , cdata ) ) Cu Zn Pb Cd Co [1,] 2.326 3.296 80.886 0.944 3.012 [2,] 0.058 0.785 13.947 1.079 4.741 [3,] 0.304 2.080 16.592 0.002 0.008 [4,] 2.901 7.008 75.708 0.096 0.233 [5,] 5.750 11.927 166.408 0.017 0.029 [6,] 3.100 4.317 25.467 0.029 0.079 [7,] 2.957 14.114 47.858 0.062 0.118 [8,] 3.062 26.478 172.852 0.361 0.699 [9,] 3.083 11.293 116.410 0.066 0.093 [10,] 2.077 8.193 33.409 0.217 0.892 [11,] 8.003 31.862 223.477 0.008 0.041 [12,] 0.791 1.915 165.978 0.140 0.396 [13,] 0.779 1.878 103.905 0.004 0.010 [14,] 0.416 1.791 25.099 0.001 0.005 [15,] 3.201 5.713 115.642 0.149 0.366 [16,] 8.122 8.662 8.021 0.982 1.611 [17,] 3.348 5.204 29.543 1.570 4.906 [18,] 3.902 6.738 80.703 0.076 0.372 [19,] 2.899 7.987 62.887 0.221 0.515 [20,] 6.563 15.896 12.331 1.530 2.307 [21,] 17.078 29.542 2.687 0.032 0.010 [22,] 2.213 4.318 14.725 0.031 0.017 [23,] 20.544 29.226 1.126 0.039 0.017 [24,] 17.409 35.494 9.552 0.231 0.076 [25,] 16.106 41.224 4.512 1.393 0.245 [26,] 22.779 55.734 17.162 0.110 0.075 [27,] 23.581 80.952 4.981 0.379 0.078 [28,] 1.832 7.271 15.774 0.196 0.048 [29,] 7.248 12.219 18.070 0.008 0.003 [30,] 7.631 27.453 7.022 10.920 2.608 [31,] 26.630 206.300 6.400 0.362 0.323 [32,] 12.953 22.467 9.398 1.605 0.584 [33,] 0.811 4.944 41.607 0.152 0.031 [34,] 1.877 33.533 27.074 0.029 0.009 [35,] 4.551 15.196 5.600 0.017 0.008 [36,] 4.971 8.440 12.354 0.271 0.141 [37,] 2.209 9.612 7.444 0.055 0.036 [38,] 16.707 11.863 72.369 0.004 0.002 [39,] 14.484 46.550 12.147 0.029 0.017 [40,] 3.663 7.029 15.216 0.856 0.498 [41,] 10.953 48.847 0.818 0.220 0.028 [42,] 32.654 615.270 1.242 0.003 0.001 [43,] 3.897 30.920 4.675 0.120 0.029 [44,] 19.815 117.820 5.003 207.885 28.325 [45,] 13.873 304.437 0.604 4.438 0.601 [46,] 11.754 241.912 1.834 0.139 0.022 [47,] 6.595 80.217 1.413 3.621 0.602 [48,] 5.035 102.716 1.608 67.029 12.505 [49,] 5.792 140.051 1.191 1.724 0.231 [50,] 104.598 684.499 0.184 0.047 0.005 [51,] 6.422 64.808 1.089 7.151 1.301 [52,] 60.777 1226.157 1.073 2.470 0.220 [53,] 66.577 585.309 3.734 0.231 0.055 [54,] 16.860 88.522 0.631 0.891 0.162 [55,] 6.272 39.097 0.708 36.115 5.228 [56,] 58.917 446.866 0.200 4.940 0.499 [57,] 33.984 384.645 0.338 0.025 0.004 [58,] 3.747 107.411 1.334 0.014 0.001 [59,] 7.169 161.079 1.003 4.233 0.651 [60,] 26.398 953.854 0.742 54.238 8.222 > qround( iit(cdata) ) Cu Zn Pb Cd Co [1,] 2.326 3.296 80.886 0.944 3.012 [2,] 0.058 0.785 13.947 1.079 4.741 [3,] 0.304 2.080 16.592 0.002 0.008 [4,] 2.901 7.008 75.708 0.096 0.233 [5,] 5.750 11.927 166.408 0.017 0.029 [6,] 3.100 4.317 25.467 0.029 0.079 [7,] 2.957 14.114 47.858 0.062 0.118 [8,] 3.062 26.478 172.852 0.361 0.699 [9,] 3.083 11.293 116.410 0.066 0.093 [10,] 2.077 8.193 33.409 0.217 0.892 [11,] 8.003 31.862 223.477 0.008 0.041 [12,] 0.791 1.915 165.978 0.140 0.396 [13,] 0.779 1.878 103.905 0.004 0.010 [14,] 0.416 1.791 25.099 0.001 0.005 [15,] 3.201 5.713 115.642 0.149 0.366 [16,] 8.122 8.662 8.021 0.982 1.611 [17,] 3.348 5.204 29.543 1.570 4.906 [18,] 3.902 6.738 80.703 0.076 0.372 [19,] 2.899 7.987 62.887 0.221 0.515 [20,] 6.563 15.896 12.331 1.530 2.307 [21,] 17.078 29.542 2.687 0.032 0.010 [22,] 2.213 4.318 14.725 0.031 0.017 [23,] 20.544 29.226 1.126 0.039 0.017 [24,] 17.409 35.494 9.552 0.231 0.076 [25,] 16.106 41.224 4.512 1.393 0.245 [26,] 22.779 55.734 17.162 0.110 0.075 [27,] 23.581 80.952 4.981 0.379 0.078 [28,] 1.832 7.271 15.774 0.196 0.048 [29,] 7.248 12.219 18.070 0.008 0.003 [30,] 7.631 27.453 7.022 10.920 2.608 [31,] 26.630 206.300 6.400 0.362 0.323 [32,] 12.953 22.467 9.398 1.605 0.584 [33,] 0.811 4.944 41.607 0.152 0.031 [34,] 1.877 33.533 27.074 0.029 0.009 [35,] 4.551 15.196 5.600 0.017 0.008 [36,] 4.971 8.440 12.354 0.271 0.141 [37,] 2.209 9.612 7.444 0.055 0.036 [38,] 16.707 11.863 72.369 0.004 0.002 [39,] 14.484 46.550 12.147 0.029 0.017 [40,] 3.663 7.029 15.216 0.856 0.498 [41,] 10.953 48.847 0.818 0.220 0.028 [42,] 32.654 615.270 1.242 0.003 0.001 [43,] 3.897 30.920 4.675 0.120 0.029 [44,] 19.815 117.820 5.003 207.885 28.325 [45,] 13.873 304.437 0.604 4.438 0.601 [46,] 11.754 241.912 1.834 0.139 0.022 [47,] 6.595 80.217 1.413 3.621 0.602 [48,] 5.035 102.716 1.608 67.029 12.505 [49,] 5.792 140.051 1.191 1.724 0.231 [50,] 104.598 684.499 0.184 0.047 0.005 [51,] 6.422 64.808 1.089 7.151 1.301 [52,] 60.777 1226.157 1.073 2.470 0.220 [53,] 66.577 585.309 3.734 0.231 0.055 [54,] 16.860 88.522 0.631 0.891 0.162 [55,] 6.272 39.097 0.708 36.115 5.228 [56,] 58.917 446.866 0.200 4.940 0.499 [57,] 33.984 384.645 0.338 0.025 0.004 [58,] 3.747 107.411 1.334 0.014 0.001 [59,] 7.169 161.079 1.003 4.233 0.651 [60,] 26.398 953.854 0.742 54.238 8.222 attr(,"class") [1] "rmult" > qround( checker( iitInv(iit(cdata)) , cdata ) ) Cu Zn Pb Cd Co [1,] 2.326 3.296 80.886 0.944 3.012 [2,] 0.058 0.785 13.947 1.079 4.741 [3,] 0.304 2.080 16.592 0.002 0.008 [4,] 2.901 7.008 75.708 0.096 0.233 [5,] 5.750 11.927 166.408 0.017 0.029 [6,] 3.100 4.317 25.467 0.029 0.079 [7,] 2.957 14.114 47.858 0.062 0.118 [8,] 3.062 26.478 172.852 0.361 0.699 [9,] 3.083 11.293 116.410 0.066 0.093 [10,] 2.077 8.193 33.409 0.217 0.892 [11,] 8.003 31.862 223.477 0.008 0.041 [12,] 0.791 1.915 165.978 0.140 0.396 [13,] 0.779 1.878 103.905 0.004 0.010 [14,] 0.416 1.791 25.099 0.001 0.005 [15,] 3.201 5.713 115.642 0.149 0.366 [16,] 8.122 8.662 8.021 0.982 1.611 [17,] 3.348 5.204 29.543 1.570 4.906 [18,] 3.902 6.738 80.703 0.076 0.372 [19,] 2.899 7.987 62.887 0.221 0.515 [20,] 6.563 15.896 12.331 1.530 2.307 [21,] 17.078 29.542 2.687 0.032 0.010 [22,] 2.213 4.318 14.725 0.031 0.017 [23,] 20.544 29.226 1.126 0.039 0.017 [24,] 17.409 35.494 9.552 0.231 0.076 [25,] 16.106 41.224 4.512 1.393 0.245 [26,] 22.779 55.734 17.162 0.110 0.075 [27,] 23.581 80.952 4.981 0.379 0.078 [28,] 1.832 7.271 15.774 0.196 0.048 [29,] 7.248 12.219 18.070 0.008 0.003 [30,] 7.631 27.453 7.022 10.920 2.608 [31,] 26.630 206.300 6.400 0.362 0.323 [32,] 12.953 22.467 9.398 1.605 0.584 [33,] 0.811 4.944 41.607 0.152 0.031 [34,] 1.877 33.533 27.074 0.029 0.009 [35,] 4.551 15.196 5.600 0.017 0.008 [36,] 4.971 8.440 12.354 0.271 0.141 [37,] 2.209 9.612 7.444 0.055 0.036 [38,] 16.707 11.863 72.369 0.004 0.002 [39,] 14.484 46.550 12.147 0.029 0.017 [40,] 3.663 7.029 15.216 0.856 0.498 [41,] 10.953 48.847 0.818 0.220 0.028 [42,] 32.654 615.270 1.242 0.003 0.001 [43,] 3.897 30.920 4.675 0.120 0.029 [44,] 19.815 117.820 5.003 207.885 28.325 [45,] 13.873 304.437 0.604 4.438 0.601 [46,] 11.754 241.912 1.834 0.139 0.022 [47,] 6.595 80.217 1.413 3.621 0.602 [48,] 5.035 102.716 1.608 67.029 12.505 [49,] 5.792 140.051 1.191 1.724 0.231 [50,] 104.598 684.499 0.184 0.047 0.005 [51,] 6.422 64.808 1.089 7.151 1.301 [52,] 60.777 1226.157 1.073 2.470 0.220 [53,] 66.577 585.309 3.734 0.231 0.055 [54,] 16.860 88.522 0.631 0.891 0.162 [55,] 6.272 39.097 0.708 36.115 5.228 [56,] 58.917 446.866 0.200 4.940 0.499 [57,] 33.984 384.645 0.338 0.025 0.004 [58,] 3.747 107.411 1.334 0.014 0.001 [59,] 7.169 161.079 1.003 4.233 0.651 [60,] 26.398 953.854 0.742 54.238 8.222 > > qround( clr(c(a=1,2,3))) a -0.597 0.096 0.501 attr(,"class") [1] "rmult" > qround( ilr(c(a=1,2,3))) [1] 0.490 0.614 attr(,"class") [1] "rmult" > qround( alr(c(a=1,2,3))) a v2 -1.099 -0.405 attr(,"class") [1] "rmult" > qround( cpt(c(a=1,2,3))) a -0.167 0.000 0.167 attr(,"class") [1] "rmult" > qround( ipt(c(a=1,2,3))) [1] 0.118 0.204 attr(,"class") [1] "rmult" > qround( apt(c(a=1,2,3))) a 0.167 0.333 attr(,"class") [1] "rmult" > qround( ilt(c(a=1,2,3))) a 0.000 0.693 1.099 attr(,"class") [1] "rmult" > qround( iit(c(a=1,2,3))) a 1 2 3 attr(,"class") [1] "rmult" > qround( checker( clrInv(clr(c(a=1,2,3))) , clo(c(1,2,3))) ) a 0.167 0.333 0.500 > qround( checker( ilrInv(ilr(c(a=1,2,3))) , clo(c(1,2,3))) ) a 0.167 0.333 0.500 > qround( checker( alrInv(alr(c(a=1,2,3))) , clo(c(1,2,3))) ) a 0.167 0.333 0.500 > qround( checker( cptInv(cpt(c(a=1,2,3))) , clo(c(1,2,3))) ) a 0.167 0.333 0.500 > qround( checker( iptInv(ipt(c(a=1,2,3))) , clo(c(1,2,3))) ) a 0.167 0.333 0.500 > qround( checker( aptInv(apt(c(a=1,2,3))) , clo(c(1,2,3))) ) a 0.167 0.333 0.500 > qround( checker( iltInv(ilt(c(a=1,2,3))) , c(1,2,3)) ) a 1 2 3 > qround( checker( iitInv(iit(c(a=1,2,3))) , c(1,2,3)) ) a 1 2 3 > > # mean > > qround( mean(acomp(cdata)) ) Cu Zn Pb Cd Co "0.142" "0.660" "0.190" "0.005" "0.003" attr(,"class") [1] "acomp" > qround( mean(rcomp(cdata)) ) Cu Zn Pb Cd Co "0.103" "0.471" "0.377" "0.035" "0.015" attr(,"class") [1] "rcomp" > qround( mean(aplus(cdata)) ) Cu Zn Pb Cd Co " 6.119" "28.498" " 8.230" " 0.231" " 0.123" attr(,"class") [1] "aplus" > qround( mean(rplus(cdata)) ) Cu Zn Pb Cd Co " 13.183" "121.516" " 31.863" " 6.997" " 1.399" attr(,"class") [1] "rplus" > > qround( meanCol(cdata) ) Cu Zn Pb Cd Co 13.183 121.516 31.863 6.997 1.399 > qround( meanCol(clo(cdata)) ) Cu Zn Pb Cd Co 0.103 0.471 0.377 0.035 0.015 > qround( clo(meanCol(cdata)) ) Cu Zn Pb Cd Co 0.075 0.695 0.182 0.040 0.008 > > # var (Variation Matrix) > qround( var(rcomp(cdata)) ) Cu Zn Pb Cd Co Cu 0.009 0.007 -0.014 -0.001 0.000 Zn 0.007 0.111 -0.115 0.000 -0.003 Pb -0.014 -0.115 0.139 -0.010 0.001 Cd -0.001 0.000 -0.010 0.010 0.002 Co 0.000 -0.003 0.001 0.002 0.001 > qround( var(acomp(cdata)) ) Cu Zn Pb Cd Co Cu 1.848 1.766 -0.417 -1.242 -1.954 Zn 1.766 2.602 -1.643 -0.691 -2.034 Pb -0.417 -1.643 5.659 -2.951 -0.649 Cd -1.242 -0.691 -2.951 2.905 1.978 Co -1.954 -2.034 -0.649 1.978 2.659 > qround( var(aplus(cdata)) ) Cu Zn Pb Cd Co Cu 1.883 2.024 -1.471 0.841 -0.227 Zn 2.024 3.084 -2.475 1.615 -0.083 Pb -1.471 -2.475 3.515 -1.958 -0.011 Cd 0.841 1.615 -1.958 7.036 5.753 Co -0.227 -0.083 -0.011 5.753 6.078 > qround( var(rplus(cdata)) ) Cu Zn Pb Cd Co Cu 349.681 3437.903 -269.782 24.114 -0.756 Zn 3437.903 57387.509 -3357.264 723.320 64.182 Pb -269.782 -3357.264 2553.597 -197.987 -26.921 Cd 24.114 723.320 -197.987 835.376 116.042 Co -0.756 64.182 -26.921 116.042 17.163 > > # clr > qround( clr(mean(acomp(cdata))) ) Cu Zn Pb Cd Co 1.069 2.608 1.366 -2.208 -2.835 attr(,"class") [1] "rmult" > qround( meanCol(clr(cdata)) ) Cu Zn Pb Cd Co 1.069 2.608 1.366 -2.208 -2.835 > qround( clrInv(meanCol(clr(cdata))) ) Cu Zn Pb Cd Co "0.142" "0.660" "0.190" "0.005" "0.003" attr(,"class") [1] "acomp" > qround( mean(acomp(cdata)) ) Cu Zn Pb Cd Co "0.142" "0.660" "0.190" "0.005" "0.003" attr(,"class") [1] "acomp" > > # ilr > qround( ilr(mean(acomp(cdata))) ) [1] 1.088 -0.386 -3.368 -3.169 attr(,"class") [1] "rmult" > qround( meanCol(ilr(cdata)) ) [1] 1.088 -0.386 -3.368 -3.169 > qround( ilrInv(meanCol(ilr(cdata))) ) 1 2 3 4 5 "0.142" "0.660" "0.190" "0.005" "0.003" attr(,"class") [1] "acomp" > qround( mean(acomp(cdata)) ) Cu Zn Pb Cd Co "0.142" "0.660" "0.190" "0.005" "0.003" attr(,"class") [1] "acomp" > > # alr > qround( alr(mean(acomp(cdata))) ) Cu Zn Pb Cd 3.904 5.442 4.200 0.627 attr(,"class") [1] "rmult" > qround( meanCol(alr(cdata)) ) Cu Zn Pb Cd 3.904 5.442 4.200 0.627 > qround( alrInv(meanCol(alr(cdata))) ) Cu Zn Pb Cd "0.142" "0.660" "0.190" "0.005" "0.003" attr(,"class") [1] "acomp" > qround( mean(acomp(cdata)) ) Cu Zn Pb Cd Co "0.142" "0.660" "0.190" "0.005" "0.003" attr(,"class") [1] "acomp" > > # Operations > mean(acomp(3 * (cdata - mean(acomp(cdata))))) Cu Zn Pb Cd Co " 0.2" " 0.2" " 0.2" " 0.2" " 0.2" attr(,"class") [1] "acomp" > > > # barplot > barplot(acomp(cdata[1:10,])) > barplot(rcomp(cdata[1:10,])) > barplot(aplus(cdata[1:10,])) > barplot(rplus(cdata[1:10,])) > > barplot(mean(acomp(cdata))) > barplot(mean(rcomp(cdata))) > barplot(mean(aplus(cdata))) > barplot(mean(rplus(cdata))) > > # piechart > pie(mean(acomp(cdata))) > pie(mean(rcomp(cdata))) > pie(mean(aplus(cdata))) > > > > # Triangular Diagrams > plot(acomp(cdata[,1:3])) > qround( mean(acomp(cdata[,1:3])) ) Cu Zn Pb "0.143" "0.665" "0.192" attr(,"class") [1] "acomp" > > # In this file we suppress unnecessary warnings targeting end-users > # Human: if you want to see them, replace suppressWarnings() by I() > suppressWarnings( plot(acomp(cdata),margin="rcomp",pca=TRUE) ) > plot(acomp(cdata),margin="acomp",pca=TRUE) > plot(acomp(cdata),margin="Cd",pca=TRUE) # bug corrected > qround( mean(acomp(cdata)) ) Cu Zn Pb Cd Co "0.142" "0.660" "0.190" "0.005" "0.003" attr(,"class") [1] "acomp" > > boxplot(acomp(cdata)) # boxplotscale > suppressWarnings( boxplot(acomp(cdata),Land,notch=TRUE) )# notch > #boxplot(acomp(cdata),Rock) > > boxplot(acomp(cdata),log=FALSE) > boxplot(acomp(cdata),Land,log=FALSE) > #boxplot(acomp(cdata),Rock,log=FALSE) > > boxplot(acomp(cdata),log=FALSE,ylim=c(0,5)) > boxplot(acomp(cdata),Land,log=FALSE,ylim=c(0,5)) > #boxplot(acomp(cdata),Rock,log=FALSE,ylim=c(0,5)) > > qqnorm(acomp(cdata),alpha=100) > qqnorm(acomp(cdata),alpha=0.05) > qqnorm(acomp(cdata[,-3]),alpha=0.05) > qqnorm(acomp(cdata[,-3]),alpha=0.05) > > #boxplot(acomp(cdata[,-1]),js$Cd) > plot(Land,data.matrix(cdata)%*% rep(1,ncol(cdata))) > > > # rcomp.plots > > boxplot(rcomp(cdata)) > boxplot(rcomp(cdata),Land) > #boxplot(rcomp)(cdata,Rock) > > qqnorm(rcomp(cdata)) > qqnorm(rcomp(cdata),alpha=0.05) > qqnorm(rcomp(cdata[,1:3]),alpha=0.05) > plot(acomp(cdata[,1:3])) > ellipses(mean(acomp(cdata[,1:3])), var(acomp(cdata,1:3)),col="red",r=2) > > ellipses(mean(rcomp(cdata[,1:3])), var(rcomp(cdata[,1:3])),col="blue",r=2) > > > plot(rplus(cdata[,1:2])) > ellipses(rplus(mean(rplus(cdata[,1:2]))), var(rplus(cdata[,1:2])),col="blue",r=2) > ellipses(aplus(mean(aplus(cdata[,1:2]))), var(aplus(cdata[,1:2])),col="red",r=2) > > plot(aplus(cdata[,1:2])) > ellipses(aplus(mean(aplus(cdata[,1:2]))), var(aplus(cdata[,1:2])),col="red",r=2) > ellipses(rplus(mean(rplus(cdata[,1:2]))), var(rplus(cdata[,1:2])),col="blue",r=2) > > > straight(acomp(c(1,1,1)),c(2,1,3)) > > > boxplot(rcomp(cdata[,-1]),cdata[,"Cd"]) > > # biplot, princomp > > biplot(princomp(cdata)) > biplot(princomp(acomp(cdata))) > biplot(princomp(rcomp(cdata))) > biplot(princomp(aplus(cdata)),choice=c(2,3)) > biplot(princomp(rplus(cdata)),choice=c(2,3)) > > summary(princomp(cdata)) Importance of components: Comp.1 Comp.2 Comp.3 Comp.4 Standard deviation 238.4225063 48.23571927 28.52016305 11.744718278 Proportion of Variance 0.9454633 0.03869793 0.01352864 0.002294222 Cumulative Proportion 0.9454633 0.98416122 0.99768986 0.999984083 Comp.5 Standard deviation 9.782767e-01 Proportion of Variance 1.591745e-05 Cumulative Proportion 1.000000e+00 > summary(princomp(acomp(cdata))) Importance of components: Comp.1 Comp.2 Comp.3 Comp.4 Standard deviation 2.8682301 2.6308756 0.56478717 0.45327390 Proportion of Variance 0.5249094 0.4416284 0.02035289 0.01310925 Cumulative Proportion 0.5249094 0.9665379 0.98689075 1.00000000 > summary(princomp(rcomp(cdata))) Importance of components: Comp.1 Comp.2 Comp.3 Comp.4 Standard deviation 0.4923727 0.13158041 0.09732249 0.03334499 Proportion of Variance 0.8968032 0.06404595 0.03503770 0.00411311 Cumulative Proportion 0.8968032 0.96084919 0.99588689 1.00000000 > summary(princomp(aplus(cdata))) Importance of components: Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Standard deviation 3.5980565 2.6323502 1.10248792 0.55006931 0.44850359 Proportion of Variance 0.5995053 0.3208813 0.05628656 0.01401173 0.00931513 Cumulative Proportion 0.5995053 0.9203866 0.97667314 0.99068487 1.00000000 > summary(princomp(rplus(cdata))) Importance of components: Comp.1 Comp.2 Comp.3 Comp.4 Standard deviation 240.4345462 48.64277897 28.76084380 11.843831582 Proportion of Variance 0.9454633 0.03869793 0.01352864 0.002294222 Cumulative Proportion 0.9454633 0.98416122 0.99768986 0.999984083 Comp.5 Standard deviation 9.865324e-01 Proportion of Variance 1.591745e-05 Cumulative Proportion 1.000000e+00 > > > # The following lines produce loadings, which are known to be defined > # only up to a sign; to ensure meaningful comparison, they are > # converted to absolute values > # Human: if you want to see the actual numbers, replace abs() by I() > abs( loadings(princomp(cdata)) ) Loadings: Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Cu 0.997 Zn 0.996 Pb 0.993 0.100 Cd 0.985 0.138 Co 0.137 0.990 Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 SS loadings 1.0 1.0 1.0 1.0 1.0 Proportion Var 0.2 0.2 0.2 0.2 0.2 Cumulative Var 0.2 0.4 0.6 0.8 1.0 > abs( loadings(princomp(acomp(cdata))) ) Loadings: Comp.1 Comp.2 Comp.3 Comp.4 Cu 0.209 0.435 0.748 Zn 0.591 0.600 0.291 Pb 0.681 0.514 0.181 0.199 Cd 0.580 0.137 0.662 Co 0.387 0.438 0.170 0.655 Comp.1 Comp.2 Comp.3 Comp.4 SS loadings 1.0 1.0 1.0 1.0 Proportion Var 0.2 0.2 0.2 0.2 Cumulative Var 0.2 0.4 0.6 0.8 > abs( loadings(princomp(rcomp(cdata))) ) Loadings: Comp.1 Comp.2 Comp.3 Comp.4 Cu 0.206 0.846 0.193 Zn 0.660 0.557 0.185 0.141 Pb 0.748 0.448 0.107 0.169 Cd 0.651 0.483 0.377 Co 0.149 0.879 Comp.1 Comp.2 Comp.3 Comp.4 SS loadings 1.0 1.0 1.0 1.0 Proportion Var 0.2 0.2 0.2 0.2 Cumulative Var 0.2 0.4 0.6 0.8 > abs( loadings(princomp(aplus(cdata))) ) Loadings: Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Cu 0.107 0.410 0.593 0.681 Zn 0.192 0.576 0.363 0.673 0.215 Pb 0.220 0.571 0.701 0.257 0.262 Cd 0.731 0.671 Co 0.607 0.415 0.134 0.657 Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 SS loadings 1.0 1.0 1.0 1.0 1.0 Proportion Var 0.2 0.2 0.2 0.2 0.2 Cumulative Var 0.2 0.4 0.6 0.8 1.0 > abs( loadings(princomp(rplus(cdata))) ) Loadings: Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Cu 0.997 Zn 0.996 Pb 0.993 0.100 Cd 0.985 0.138 Co 0.137 0.990 Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 SS loadings 1.0 1.0 1.0 1.0 1.0 Proportion Var 0.2 0.2 0.2 0.2 0.2 Cumulative Var 0.2 0.4 0.6 0.8 1.0 > > > #names > qround( meanCol(cdata[,1:3]) ) Cu Zn Pb 13.183 121.516 31.863 > qround( mean(acomp(cdata[,1:3])) ) Cu Zn Pb "0.143" "0.665" "0.192" attr(,"class") [1] "acomp" > oneOrDataset(c(a=1,b=2,c=3)) a b c [1,] 1 2 3 > > # covariance > qround( cov(acomp(cd1),acomp(cd2)) ) Cd Co Cu 0.397 -0.397 Zn 0.713 -0.713 Pb -1.110 1.110 > qround( cov(rcomp(cd1),rcomp(cd2)) ) Cd Co Cu 0.007 -0.007 Zn 0.077 -0.077 Pb -0.085 0.085 > qround( cov(aplus(cd1),aplus(cd2)) ) Cd Co Cu 0.841 -0.227 Zn 1.615 -0.083 Pb -1.958 -0.011 > qround( cov(rplus(cd1),rplus(cd2)) ) Cd Co Cu 24.114 -0.756 Zn 723.320 64.182 Pb -197.987 -26.921 > > # tmp <- princov(acomp(cd1,cd2)) > # The following line produce loadings and scores, which are known to be defined > # only up to a sign; to ensure meaningful comparison, they are > # commented > # Human: if you want to see the actual numbers, uncomment next lines > #tmp > > tmp <- princomp(acomp(cdata)) > # tmp > plot(tmp) > biplot(tmp) > biplot(tmp,ch=2:3) > > #pplot(acomp(cdata)) > > > proc.time() user system elapsed 1.95 0.26 2.17