Wu et al. (2021) took soil samples at 300 sites near the Three Gorges Reservoir in China. Each site was classified into one of three categories of land use: orchard (n = 75), dry land (n = 98), and paddy field (n = 127). They also measured the concentrations of ten metals (Ca, Cd, Cr, Cu, Fe, Mg, Mn, Ni, Pb, and Zn; mg/kg) and five soil characteristics (pH, concentrations of N and P in mg/kg, and % of soil organic carbon [SOC] and K) for each site. Wu et al. (2021) did a PCA on the metals and used the components in further analyses. Using PCA, we will instead examine the pattern among sites and land use categories based on the metals and the other characteristics (15 variables in total).

The paper is here

Wu, W., Li, Y., Yan, M., Yang, L., Lei, J. & Liu, H. B. (2021). Surface soil metal elements variability affected by environmental and soil properties. PLoS One, 16, e0254928.

Preliminaries

packages: vegan, Rmisc, lmodel2, pscych; ggvegan & ggfortify for graphics


source("../R/libraries.R")   #This is the common library
library(vegan)
library(ggvegan)
library(ggfortify)
library(lmodel2)
library(psych)
library(MultBiplotR)
# ggvegan is used for some graphics; it needs to be installed from github. Use the code in the next line to install it.
#remotes::install_github("gavinsimpson/ggvegan") #Use once to get ggvegan
source("../R/appearance.R")   #This is the set of graphics tweaks for figs

Run evplot function needed to draw broken stick graph

Needs function from Legendre & Legendre book

source ('http://www.davidzeleny.net/anadat-r/doku.php/en:numecolr:evplot?do=export_code&codeblock=1')

Read in the data (wu.csv)

wu <- read_csv("../data/wu.csv")
Rows: 300 Columns: 17── Column specification ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr  (1): landuse
dbl (16): ca, cr, cu, fe, mn, pb, zn, cd, mg, ni, soc, ph, n, k, p, group
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(wu, 10)

Quick data summary

wu %>%
  summarise_all(list(Mean=mean, SD=sd, Max=max,Min=min))
Warning: There were 2 warnings in `summarise()`.
The first warning was:
ℹ In argument: `landuse_Mean = (new("standardGeneric", .Data = function (x, ...) ...`.
Caused by warning in `mean.default()`:
! argument is not numeric or logical: returning NA
ℹ Run ]8;;ide:run:dplyr::last_dplyr_warnings()dplyr::last_dplyr_warnings()]8;; to see the 1 remaining warning.

Diagnostic checks

Correlation and scatterplot matrices

wu.cor<-cor(wu[,c('ca','cd','cr','cu','fe','mg','mn','ni','pb','zn','ph','soc','n','p','k')])
options(digits = 2)
wu.cor
        ca   cd    cr     cu    fe     mg    mn    ni    pb    zn     ph    soc      n      p      k
ca   1.000 0.41 0.503  0.670  0.69  0.809  0.72  0.68 0.200 0.737  0.686 -0.242 -0.074  0.473  0.712
cd   0.414 1.00 0.483  0.515  0.46  0.489  0.37  0.51 0.487 0.624  0.324  0.246  0.426  0.297  0.481
cr   0.503 0.48 1.000  0.843  0.87  0.787  0.59  0.90 0.646 0.763  0.306  0.024  0.250  0.252  0.735
cu   0.670 0.52 0.843  1.000  0.90  0.882  0.72  0.89 0.626 0.893  0.346 -0.057  0.175  0.466  0.813
fe   0.691 0.46 0.869  0.904  1.00  0.918  0.78  0.93 0.631 0.878  0.347 -0.111  0.151  0.363  0.844
mg   0.809 0.49 0.787  0.882  0.92  1.000  0.79  0.92 0.470 0.887  0.477 -0.174  0.075  0.425  0.919
mn   0.722 0.37 0.590  0.724  0.78  0.794  1.00  0.72 0.338 0.727  0.383 -0.340 -0.184  0.398  0.726
ni   0.677 0.51 0.897  0.888  0.93  0.917  0.72  1.00 0.608 0.852  0.434 -0.103  0.168  0.315  0.869
pb   0.200 0.49 0.646  0.626  0.63  0.470  0.34  0.61 1.000 0.589  0.024  0.311  0.500  0.202  0.494
zn   0.737 0.62 0.763  0.893  0.88  0.887  0.73  0.85 0.589 1.000  0.393  0.013  0.242  0.559  0.841
ph   0.686 0.32 0.306  0.346  0.35  0.477  0.38  0.43 0.024 0.393  1.000 -0.098 -0.041  0.148  0.449
soc -0.242 0.25 0.024 -0.057 -0.11 -0.174 -0.34 -0.10 0.311 0.013 -0.098  1.000  0.722 -0.042 -0.131
n   -0.074 0.43 0.250  0.175  0.15  0.075 -0.18  0.17 0.500 0.242 -0.041  0.722  1.000  0.039  0.088
p    0.473 0.30 0.252  0.466  0.36  0.425  0.40  0.32 0.202 0.559  0.148 -0.042  0.039  1.000  0.409
k    0.712 0.48 0.735  0.813  0.84  0.919  0.73  0.87 0.494 0.841  0.449 -0.131  0.088  0.409  1.000
scatterplotMatrix(~ca+cr+cu+fe+mn+pb+zn+cd+mg+ni+soc+ph+n+k+p,data=wu,diagonal=list(method='boxplot'))

Correlations low, so no issues, and boxplots also look fine

Plot component 1 using RMA regression

wu1.rma <- lmodel2(cu~mn, data=wu)
RMA was not requested: it will not be computed.

No permutation test will be performed
print(wu1.rma)

Model II regression

Call: lmodel2(formula = cu ~ mn, data = wu)

n = 300   r = 0.72   r-square = 0.52 
Parametric P-values:   2-tailed = 5.4e-50    1-tailed = 2.7e-50 
Angle between the two OLS regression lines = 1.1 degrees

Regression results

Confidence intervals

Eigenvalues: 39299 16 

H statistic used for computing C.I. of MA: 5.4e-06 
plot(wu1.rma, method="SMA")

Check factorability of correlation matrix with Bartlett and KMO tests

cortest.bartlett(wu.cor, n=300)
$chisq
[1] 5543

$p.value
[1] 0

$df
[1] 105
KMO(wu.cor)
Kaiser-Meyer-Olkin factor adequacy
Call: KMO(r = wu.cor)
Overall MSA =  0.9
MSA for each item = 
  ca   cd   cr   cu   fe   mg   mn   ni   pb   zn   ph  soc    n    p    k 
0.87 0.89 0.91 0.96 0.91 0.90 0.95 0.93 0.88 0.93 0.76 0.68 0.69 0.84 0.93 

Do PCA on correlation matrix; get summary with scaling=2

Scaling=2 is the rda default: angles between variables match their correlations)

Get eigenvalues

wu1.rda <- rda(wu[,c('ca','cd','cr','cu','fe','mg','mn','ni','pb','zn','ph','soc','n','p','k')],scale=TRUE)
summary(wu1.rda)

Call:
rda(X = wu[, c("ca", "cd", "cr", "cu", "fe", "mg", "mn", "ni",      "pb", "zn", "ph", "soc", "n", "p", "k")], scale = TRUE) 

Partitioning of correlations:
              Inertia Proportion
Total              15          1
Unconstrained      15          1

Eigenvalues, and their contribution to the correlations 

Importance of components:
                        PC1   PC2    PC3    PC4    PC5    PC6    PC7    PC8    PC9   PC10    PC11    PC12   PC13    PC14    PC15
Eigenvalue            8.569 2.372 1.0935 0.9056 0.4962 0.3174 0.3029 0.2471 0.2141 0.1577 0.10979 0.07509 0.0584 0.04970 0.03206
Proportion Explained  0.571 0.158 0.0729 0.0604 0.0331 0.0212 0.0202 0.0165 0.0143 0.0105 0.00732 0.00501 0.0039 0.00331 0.00214
Cumulative Proportion 0.571 0.729 0.8023 0.8626 0.8957 0.9169 0.9371 0.9535 0.9678 0.9783 0.98565 0.99065 0.9945 0.99786 1.00000

Scaling 2 for species and site scores
* Species are scaled proportional to eigenvalues
* Sites are unscaled: weighted dispersion equal on all dimensions
* General scaling constant of scores:  8.2 


Species scores

       PC1      PC2     PC3     PC4     PC5      PC6
ca  -1.673  0.73464 -0.7817  0.0336 -0.1795 -0.10080
cd  -1.283 -0.80689 -0.7180 -0.0338  1.2602 -0.06146
cr  -1.809 -0.36026  0.5440  0.3633 -0.1300  0.14124
cu  -1.978 -0.09496  0.2925 -0.1301 -0.1069  0.06529
fe  -2.002  0.00608  0.4533  0.1152 -0.1312 -0.07707
mg  -2.021  0.29000  0.0449  0.0925 -0.1401 -0.31282
mn  -1.700  0.74984  0.1832 -0.1320  0.2750 -0.22042
ni  -1.996 -0.02427  0.3224  0.3420 -0.0996  0.00575
pb  -1.303 -1.18080  0.6479 -0.0177  0.1238  0.79576
zn  -1.997 -0.16899 -0.1105 -0.3183  0.0180 -0.15278
ph  -1.032  0.57411 -1.3614  0.8911 -0.2562  0.52991
soc  0.159 -1.81601 -0.5575  0.0235 -0.4705 -0.25071
n   -0.381 -1.87092 -0.3566  0.0755 -0.2315 -0.26461
p   -1.028  0.16134 -0.5502 -1.6814 -0.2706  0.29399
k   -1.919  0.18927  0.0555  0.0808 -0.1221 -0.26439


Site scores (weighted sums of species scores)

            PC1      PC2       PC3      PC4      PC5      PC6
sit1   -0.03038  0.64034 -0.109345  0.22383 -0.29383 -0.70457
sit2    0.84026  0.15183 -0.288681  0.32834 -0.19093 -0.03959
sit3   -0.35037 -0.26368 -0.026194 -0.02082 -0.57994 -0.90679
sit4   -0.00303 -0.15076 -0.046570  0.28596 -0.61496 -0.57578
sit5    0.98416  0.42753  0.151616  0.04959 -0.12893 -0.25907
sit6   -0.40257  0.63272  0.237559  0.21869 -0.31848 -0.29623
sit7   -0.58068 -0.01808 -0.491776 -0.46755  0.44260 -0.06524
sit8   -0.85508 -0.35385 -1.696847 -2.99333 -1.57147  0.18100
sit9    0.98354  0.11613 -0.349008  0.28803 -0.18578 -0.50674
sit10  -0.36873 -0.16939 -0.413151 -0.29167  0.57334 -0.19274
sit11   0.42350  0.89362  0.030590  0.75082  0.23293  0.08744
sit12  -0.14599  0.54959  0.164645  0.42992 -0.21286 -0.45414
sit13  -0.58334  0.30026 -0.137616 -0.31719 -0.19444 -0.18956
sit14  -0.64707  0.55656 -0.264480  0.07264 -0.62501  0.67526
sit15  -0.59340  0.03864 -0.191748 -0.58468  0.76556  0.15235
sit16  -0.24515 -0.06813  0.098543  0.74798  0.06568 -0.32833
sit17   0.95624  0.20927 -0.031550  0.08201 -0.06366  0.01575
sit18   0.37838  1.01480 -0.911908  0.63430 -0.19098  0.09601
sit19   0.99011  0.12954 -0.623435 -0.06517  0.04517 -0.12919
sit20  -0.22653 -0.83435 -0.760648  0.17703  0.36604 -0.31326
sit21  -0.03522 -0.41642 -0.533891  0.33645  0.33621 -0.71747
sit22   0.91383  0.12781 -0.425147 -0.23368 -0.48825 -0.44271
sit23  -0.76422  0.63138 -0.239592  0.10894  0.33460  1.07766
sit24   0.45381  0.76412 -0.056604 -0.03986  0.00228 -0.59971
sit25   0.87324  0.06150 -0.712387  0.46136  0.29443  0.21169
sit26   0.80826  0.53381  0.058819 -0.51326  0.44453  0.42455
sit27  -0.45550 -0.30262 -0.175423 -0.67569 -0.01270  0.34240
sit28   0.40144  0.48167  0.117555  0.02206  0.92818 -0.02719
sit29   0.02014  0.42150  0.407411  0.53306  0.45029 -0.64040
sit30   0.86575 -0.20638 -0.236184 -0.18018 -0.19296 -0.14518
sit31   0.30569  0.33063 -0.091512 -0.73013  0.68436  0.32438
sit32   0.48815  0.57794 -0.198691 -0.46984  0.13136  0.04315
sit33   0.20219 -0.55376  0.250076  0.33403  0.13929 -0.20699
sit34   0.54382  0.16318 -0.064764  0.30761  0.44284 -0.54123
sit35  -0.56750  0.52310 -1.253458  0.43080 -0.93710 -0.20752
sit36  -0.51664  0.65167 -0.468916  0.21262 -0.41679 -0.33269
sit37   0.91538 -0.55212 -0.636949  0.40022  0.04224 -0.29555
sit38   0.99539 -0.27610 -0.424983  0.08491  0.17598 -0.62818
sit39   0.54347  0.40092 -0.337390  0.10262  0.42583 -0.38222
sit40   0.72192 -0.35784 -0.347598 -0.41641 -0.27299  0.35913
sit41  -0.36593  0.32415  0.370403 -0.13329 -0.37275 -0.66125
sit42   0.94281  0.21728  0.014807  0.15986  0.03676  0.03248
sit43  -0.25098  0.66475  0.180785  0.32930 -0.45996 -0.09509
sit44   0.88726 -0.56525 -0.406427  0.27600  0.13362 -0.11964
sit45  -0.30474 -0.27008  0.685008  0.17626 -0.16271 -0.18933
sit46   0.80272 -0.22520 -0.111144 -0.12448 -0.44029 -0.02069
sit47   0.99033 -0.00584 -0.217643  0.23865  0.03389 -0.00266
sit48   1.03624  0.32107 -0.190318 -0.20682 -0.26105 -0.82960
sit49   0.89442  0.41079  0.160182  0.48030  0.21151  0.24572
sit50   0.68478 -0.42128 -0.457865 -0.12640  0.45122  0.15669
sit51   0.65534  0.13647 -0.050409 -0.46088  0.98329  1.11789
sit52  -0.15934 -0.40716  0.079905  0.26992 -0.19405 -0.50159
sit53   1.05886 -0.20587 -0.605167  0.07853 -0.38729 -0.77658
sit54   0.95500 -0.04034 -0.396287 -1.38790 -0.71388  0.19205
sit55  -0.01788 -0.50749  0.429453  0.16971  0.37308 -0.41035
sit56  -0.03869 -0.28645 -0.327042  0.22183  1.52195 -0.43765
sit57  -0.05350  0.25883  0.081825 -0.22183  0.12695 -0.43069
sit58  -0.24725  0.06360  0.359778  0.45847 -0.19463 -0.08198
sit59  -0.33653  0.10375  0.226108  0.40353  0.20237  0.12314
sit60   0.60453  0.01329  0.094932  0.19312  0.18178  0.22356
sit61   0.96996  0.54705 -0.037465  0.40710  0.15011  0.16168
sit62   0.40945  0.57680  0.383108  0.75270 -0.03176  0.55991
sit63   0.84410  0.38396  0.185879 -0.50502 -0.33948  0.41135
sit64   0.84952 -0.38460 -0.395179  0.15458  0.29168  0.27102
sit65   0.85752 -0.39914  0.224006 -0.13282 -0.22379  0.19481
sit66   0.76421 -0.18422 -0.037210 -0.22178  0.10263  0.34809
sit67   0.03118 -0.04986  0.991614  0.52765 -0.51914  0.23217
sit68   0.91625 -0.20661  0.191133 -0.09422 -0.01234 -0.47332
sit69   0.85161  0.16384 -0.177903 -0.15496  0.16378  0.52652
sit70  -0.33576  0.30945  0.871905 -0.35423  0.05884 -0.14938
sit71   0.77174  0.00432 -0.321237 -1.22836 -0.33655  0.08483
sit72   0.82466 -0.29219 -0.287940 -0.82997 -0.81533 -0.32373
sit73   1.10583  0.76943  0.055220  0.49551  0.00273  0.15985
sit74   0.77078 -0.45860 -0.220338  0.18457  0.16178 -0.05867
sit75   0.47820 -0.81069 -1.689558 -0.41513  1.62689 -0.67169
sit76   0.94945 -0.47983 -0.363087  0.29701 -0.03475  0.02615
sit77  -0.21194  0.16110  0.174987 -0.18387  0.85329  0.03299
sit78  -0.04520  0.16923  0.347889  0.33209  0.04406 -0.03268
sit79  -0.41870  0.23026  0.877045 -0.37852  0.01922  0.28543
sit80   0.28008 -0.16493 -0.066762  0.33644  0.50503 -0.11089
sit81   0.98514 -0.04808 -0.352426 -0.77645 -0.42609 -0.43147
sit82  -0.25610 -0.49471  0.319517  0.29210 -0.82370 -0.76034
sit83   0.50249 -0.67119 -0.095541 -0.68387 -0.34372  1.14114
sit84   0.83232  0.21262 -0.118400  0.14589  0.15976 -0.29446
sit85  -0.38652  0.05843  0.287909 -0.06790 -0.32717 -0.33980
sit86  -0.25108 -0.63877  0.214309  0.45541 -0.86807 -0.93606
sit87   0.25974 -0.26174  0.174663 -0.12685 -0.12929  0.01438
sit88  -0.25704  0.78439  0.013215 -0.13180  0.11299  0.34442
sit89  -0.45140 -0.53133 -0.695793 -0.54765 -0.21354  0.27344
sit90   0.64128  0.34097 -0.279233  0.46676 -0.20608  0.51035
sit91  -0.64659  0.61034 -0.817164 -0.01145 -0.21246  0.68389
sit92   0.10098  0.34895  0.720644  0.44035 -0.42487  0.13639
sit93   0.95073 -0.03592 -0.000741 -0.14782 -0.25148 -0.33553
sit94   0.83144  0.42293  0.366459 -0.30870  0.03220 -0.18529
sit95   0.53691  0.03510 -0.050579 -0.37934 -0.13483 -0.26410
sit96  -0.36948  0.19011  0.761150  0.26652 -0.38918  0.05394
sit97   0.52231 -0.69860  0.593382 -0.24552 -0.37721  0.63414
sit98   0.67004  1.68299 -0.836328  0.24949 -0.32140  0.06023
sit99  -0.55652 -1.22535 -0.549949 -0.17052  1.62485  0.26493
sit100 -0.33336  0.17451 -0.206577  0.84938 -0.53537  0.05068
sit101  0.53589 -0.62324 -0.403488  0.33670 -0.15560 -0.56905
sit102 -0.26054 -0.32404  0.028003  0.70146 -0.47282  0.05919
sit103  0.69998 -0.43743  0.312200  0.23414 -0.10471 -0.01161
sit104  0.60290 -0.64301  0.489425 -0.30806 -0.74171  0.52545
sit105  0.15064  0.09580  0.019904 -0.57583  0.81814 -0.50851
sit106  0.02016 -0.15742  0.280653 -0.69606  0.52492  0.13406
sit107  0.09545 -0.16962 -0.401049  0.20590 -0.34068  0.58032
sit108  0.05620  0.18699  0.406874  0.21893 -0.05907 -0.15466
sit109  0.75381 -0.21891  0.202418 -0.54371 -0.17911  1.50933
sit110 -0.05792 -0.43029 -0.002717  0.63067 -0.21896 -0.06820
sit111  0.03977 -0.37006 -0.107957  0.51598  0.26312 -0.04787
sit112 -0.15197  1.06810  0.162196  0.38052 -0.86179 -0.30789
sit113 -0.22456 -0.74473 -0.278456  0.40214 -0.51583 -0.70981
sit114 -0.42343  1.11245 -0.187254  0.14738 -1.33455  0.55869
sit115  0.04853  0.54398  0.035857  0.54867  0.35229  0.24703
sit116  0.36731 -0.67467 -0.260796 -0.29927 -0.04542  0.13526
sit117 -0.25559 -0.44517  0.070666  0.19068  0.22300 -0.07460
sit118  0.23676 -0.72939  0.750300 -0.02923 -0.36133  0.33184
sit119 -0.49218  0.62859  0.697479  0.05794 -0.40776  0.76603
sit120 -0.62490  0.42341 -0.318976 -0.21196  0.05785  0.65165
sit121 -0.88769  0.13290 -1.030110 -0.32962  1.03893  0.68458
sit122 -0.51470 -0.67787 -0.066520  0.13300 -0.43391 -0.21198
sit123 -0.24982 -0.74129 -0.533758  0.60559 -0.19092 -0.06139
sit124 -0.83827  0.21503 -0.194639 -0.14266  0.64998  0.51986
sit125 -0.45950  0.33629  0.321936 -0.64473 -0.02268  0.18754
sit126  0.46991 -0.31873 -0.089426  0.37334  0.16619  0.49435
sit127 -0.24860  0.19044  0.110520  0.11457 -0.13182 -0.10412
sit128 -0.41091 -0.15256 -0.163443 -0.97239 -0.15813 -0.15202
sit129 -0.66937 -1.01067 -0.891384  0.46793 -0.43291  0.02218
sit130 -0.11266  0.56793 -1.300578  0.00941  0.19496  0.75833
sit131  0.18361 -0.39646  0.205000  0.15590  0.57249  0.55430
sit132 -0.31427  0.53230 -0.593953 -0.69435  0.56428  0.37334
sit133 -0.44733  0.01588 -0.045504  0.14537  0.18378 -0.01000
sit134  0.00754  0.46873 -0.635433 -0.46518  0.47725  0.55156
sit135 -0.23307  0.38472  0.644048 -0.38041 -0.06494 -0.46531
sit136 -0.02631 -0.14203  0.395565 -0.59902 -0.39468  0.02857
sit137  0.10630  0.41208 -1.001357 -0.10516 -0.27798  0.38550
sit138 -0.07897 -0.09306  0.347071 -0.17537 -0.30332 -1.05120
sit139 -0.22000  0.50816  0.037893  0.14495  0.36332 -0.29977
sit140 -0.44342 -0.11055  0.348489 -1.00349  0.13505 -0.05877
sit141 -0.28421 -0.55708 -0.010413  0.58647 -0.32588  0.61289
sit142 -0.19813  0.08739  0.099183 -0.01113 -0.01903 -0.40294
sit143 -0.47067  0.38858 -0.209252 -0.04971  0.40011  0.64293
sit144  0.02315 -0.08551  0.039917  0.67363 -0.46307  0.15066
sit145 -0.05353  0.26422  0.230355  0.50745  0.14649  0.29862
sit146 -0.52086 -0.05178 -0.687777  0.55296 -1.00627  0.51699
sit147  0.26555  0.22166  0.053388  0.51089 -0.42762  0.52064
sit148 -0.39701 -0.36015  0.304932  0.13926  0.20099 -0.12847
sit149 -0.78689  0.47460  0.171431 -0.56653  0.40982  0.87653
sit150 -0.09124  0.24810  0.625206 -0.49705 -0.58089 -0.48599
sit151 -0.48999  0.56456 -0.280333  0.15413  0.07581  0.51491
sit152 -0.47322  0.57744  0.101026 -0.36726 -0.08133  0.16306
sit153 -0.32830  0.35191  0.423870 -0.46352 -0.30743 -0.51420
sit154 -0.35031  0.20057  0.511371 -0.23284 -0.44792 -0.13179
sit155 -0.50918 -0.05686  0.461419 -0.22569 -0.05643  0.20794
sit156 -0.22932  0.55058  0.719307  0.13361 -0.07677  0.05101
sit157 -0.32926  0.06499  0.514853 -0.35162 -0.11231 -0.63351
sit158  0.10676  0.77199  0.175105  0.65119 -0.20209  0.04840
sit159  0.22178 -0.39901  0.176988 -0.14964  0.06892  0.70598
sit160 -0.09656  0.28713  0.001792 -0.67271 -0.40999 -0.67553
sit161 -0.14484  0.65892 -1.067084  0.13818 -1.21213  0.97429
sit162 -0.04209  0.82201 -0.369958  0.21862  0.17951  0.20013
sit163 -0.22525  0.35089 -0.309984  0.59043 -1.24412  0.21428
sit164 -0.21363 -0.48561  0.662880  0.17333 -0.00848  0.12093
sit165 -0.31852  0.37698  0.205071 -0.33142  0.41930 -0.35217
sit166  0.40735 -0.16938  0.519018 -0.46086 -0.33392  0.04749
 [ reached getOption("max.print") -- omitted 134 rows ]
wu1.eig <- wu1.rda$CA$eig
wu1.eig
  PC1   PC2   PC3   PC4   PC5   PC6   PC7   PC8   PC9  PC10  PC11  PC12  PC13  PC14  PC15 
8.569 2.372 1.094 0.906 0.496 0.317 0.303 0.247 0.214 0.158 0.110 0.075 0.058 0.050 0.032 

Get scree and broken stick plots

screeplot(wu1.rda,bstick=TRUE, bst.col="black",xlab = "Component", ylab = "Inertia",)

bstick(wu1.rda)
  PC1   PC2   PC3   PC4   PC5   PC6   PC7   PC8   PC9  PC10  PC11  PC12  PC13  PC14  PC15 
3.318 2.318 1.818 1.485 1.235 1.035 0.868 0.725 0.600 0.489 0.389 0.298 0.215 0.138 0.067 

Alternative run evplot function to draw broken stick graph

evplot(wu1.eig)

Retain the first 2 or 3 components

Get eigenvectors coefficients This can be done in two ways:

scores(wu1.rda, choices=c(1:3), display='species', scaling = 0)
       PC1     PC2    PC3
ca  -0.270  0.2258 -0.354
cd  -0.207 -0.2480 -0.325
cr  -0.292 -0.1107  0.246
cu  -0.320 -0.0292  0.132
fe  -0.324  0.0019  0.205
mg  -0.327  0.0891  0.020
mn  -0.275  0.2304  0.083
ni  -0.323 -0.0075  0.146
pb  -0.211 -0.3629  0.293
zn  -0.323 -0.0519 -0.050
ph  -0.167  0.1764 -0.616
soc  0.026 -0.5581 -0.252
n   -0.062 -0.5749 -0.161
p   -0.166  0.0496 -0.249
k   -0.310  0.0582  0.025
attr(,"const")
[1] 8.2
# alternatively
wu1.vec <- eigen(wu.cor)
print(wu1.vec)
eigen() decomposition
$values
 [1] 8.569 2.372 1.094 0.906 0.496 0.317 0.303 0.247 0.214 0.158 0.110 0.075 0.058 0.050 0.032

$vectors
        [,1]    [,2]   [,3]    [,4]   [,5]    [,6]    [,7]   [,8]    [,9]  [,10]  [,11]   [,12]  [,13]   [,14]   [,15]
 [1,] -0.270  0.2258  0.354 -0.0167  0.121 -0.0847  0.1746  0.247 -0.2036  0.533  0.429  0.2002 -0.221  0.1397 -0.1364
 [2,] -0.207 -0.2480  0.325  0.0168 -0.847 -0.0516 -0.1428 -0.135  0.0426  0.054  0.073  0.0711  0.076 -0.0937 -0.0430
 [3,] -0.292 -0.1107 -0.246 -0.1807  0.087  0.1186 -0.3525 -0.452 -0.2734 -0.151  0.343  0.0084 -0.463 -0.0058  0.1696
 [4,] -0.320 -0.0292 -0.132  0.0647  0.072  0.0548 -0.0741 -0.150 -0.1660  0.267 -0.671  0.5210 -0.039 -0.0319 -0.1276
 [5,] -0.324  0.0019 -0.205 -0.0573  0.088 -0.0647  0.0653  0.029 -0.1635  0.061  0.107 -0.2946  0.273 -0.6903 -0.3910
 [6,] -0.327  0.0891 -0.020 -0.0460  0.094 -0.2628 -0.0658  0.090  0.1362  0.082  0.051  0.1097  0.346 -0.1696  0.7771
 [7,] -0.275  0.2304 -0.083  0.0656 -0.185 -0.1852  0.6527 -0.058 -0.2594 -0.514 -0.035  0.0822 -0.079  0.1272  0.0341
 [8,] -0.323 -0.0075 -0.146 -0.1701  0.067  0.0048 -0.1991 -0.051  0.0205 -0.083  0.138 -0.0320  0.568  0.6059 -0.2864
 [9,] -0.211 -0.3629 -0.293  0.0088 -0.083  0.6685  0.3467  0.278  0.1947  0.117  0.110  0.0235 -0.028  0.0350  0.1420
[10,] -0.323 -0.0519  0.050  0.1583 -0.012 -0.1283  0.0062  0.019  0.0154  0.224 -0.355 -0.7314 -0.253  0.2487  0.1048
[11,] -0.167  0.1764  0.616 -0.4432  0.172  0.4451 -0.0081 -0.053  0.0103 -0.253 -0.210 -0.0987  0.048 -0.1101  0.0417
[12,]  0.026 -0.5581  0.252 -0.0117  0.316 -0.2106  0.3950 -0.513  0.1779  0.111  0.074  0.0324  0.096  0.0082 -0.0291
[13,] -0.062 -0.5749  0.161 -0.0375  0.156 -0.2223 -0.1738  0.553 -0.3399 -0.312 -0.062  0.0772 -0.075  0.0156 -0.0086
[14,] -0.166  0.0496  0.249  0.8362  0.182  0.2470 -0.1710 -0.087 -0.0068 -0.213  0.128  0.0341  0.112 -0.0457 -0.0121
[15,] -0.310  0.0582 -0.025 -0.0402  0.082 -0.2221 -0.0967  0.149  0.7456 -0.234  0.025  0.1527 -0.334 -0.0666 -0.2459

Get true loadings as correlations; can also be done in a couple of ways

wu1.load <- eigen.loadings(wu1.vec)
print(wu1.load)
        [,1]    [,2]   [,3]    [,4]    [,5]    [,6]    [,7]    [,8]    [,9]  [,10]   [,11]   [,12]   [,13]   [,14]   [,15]
 [1,] -0.792  0.3477  0.370 -0.0159  0.0849 -0.0477  0.0961  0.1226 -0.0942  0.212  0.1423  0.0549 -0.0534  0.0312 -0.0244
 [2,] -0.607 -0.3819  0.340  0.0160 -0.5964 -0.0291 -0.0786 -0.0672  0.0197  0.021  0.0240  0.0195  0.0185 -0.0209 -0.0077
 [3,] -0.856 -0.1705 -0.257 -0.1719  0.0615  0.0668 -0.1940 -0.2246 -0.1265 -0.060  0.1137  0.0023 -0.1120 -0.0013  0.0304
 [4,] -0.936 -0.0449 -0.138  0.0616  0.0506  0.0309 -0.0408 -0.0745 -0.0768  0.106 -0.2223  0.1428 -0.0093 -0.0071 -0.0229
 [5,] -0.947  0.0029 -0.215 -0.0545  0.0621 -0.0365  0.0360  0.0143 -0.0757  0.024  0.0354 -0.0807  0.0661 -0.1539 -0.0700
 [6,] -0.957  0.1372 -0.021 -0.0438  0.0663 -0.1480 -0.0362  0.0448  0.0630  0.032  0.0171  0.0301  0.0837 -0.0378  0.1392
 [7,] -0.804  0.3549 -0.087  0.0625 -0.1302 -0.1043  0.3592 -0.0286 -0.1200 -0.204 -0.0115  0.0225 -0.0190  0.0284  0.0061
 [8,] -0.945 -0.0115 -0.153 -0.1618  0.0471  0.0027 -0.1096 -0.0253  0.0095 -0.033  0.0457 -0.0088  0.1373  0.1351 -0.0513
 [9,] -0.617 -0.5588 -0.307  0.0084 -0.0586  0.3766  0.1908  0.1384  0.0901  0.046  0.0363  0.0064 -0.0067  0.0078  0.0254
[10,] -0.945 -0.0800  0.052  0.1507 -0.0085 -0.0723  0.0034  0.0093  0.0071  0.089 -0.1176 -0.2004 -0.0612  0.0555  0.0188
[11,] -0.488  0.2717  0.644 -0.4217  0.1212  0.2508 -0.0044 -0.0263  0.0048 -0.101 -0.0697 -0.0270  0.0117 -0.0245  0.0075
[12,]  0.075 -0.8595  0.264 -0.0111  0.2227 -0.1187  0.2174 -0.2550  0.0823  0.044  0.0244  0.0089  0.0232  0.0018 -0.0052
[13,] -0.180 -0.8854  0.169 -0.0357  0.1096 -0.1252 -0.0957  0.2750 -0.1573 -0.124 -0.0204  0.0211 -0.0181  0.0035 -0.0015
[14,] -0.487  0.0764  0.260  0.7958  0.1281  0.1391 -0.0941 -0.0432 -0.0031 -0.085  0.0424  0.0094  0.0271 -0.0102 -0.0022
[15,] -0.908  0.0896 -0.026 -0.0382  0.0578 -0.1251 -0.0532  0.0739  0.3450 -0.093  0.0082  0.0418 -0.0806 -0.0148 -0.0440
# can also get loadings from principal in psych package
wu1.pca <- principal(wu.cor, n.obs=300, nfactors=3, rotate="none", residuals=TRUE)
print(wu1.pca)
Principal Components Analysis
Call: principal(r = wu.cor, nfactors = 3, residuals = TRUE, rotate = "none", 
    n.obs = 300)
Standardized loadings (pattern matrix) based upon correlation matrix

                       PC1  PC2  PC3
SS loadings           8.57 2.37 1.09
Proportion Var        0.57 0.16 0.07
Cumulative Var        0.57 0.73 0.80
Proportion Explained  0.71 0.20 0.09
Cumulative Proportion 0.71 0.91 1.00

Mean item complexity =  1.5
Test of the hypothesis that 3 components are sufficient.

The root mean square of the residuals (RMSR) is  0.05 
 with the empirical chi square  141  with prob <  6.2e-08 

Fit based upon off diagonal values = 0.99

Get correlation residuals - two methods from psych package

residuals(wu1.pca, diag=TRUE)
    ca    cd    cr    cu    fe    mg    mn    ni    pb    zn    ph    soc   n     p     k    
ca   0.12                                                                                    
cd  -0.06  0.37                                                                              
cr  -0.02 -0.01  0.17                                                                        
cu   0.00 -0.02  0.00  0.10                                                                  
fe   0.02 -0.04  0.00 -0.01  0.06                                                            
mg   0.01 -0.03 -0.01 -0.01  0.01  0.07                                                      
mn  -0.01  0.05 -0.06 -0.03  0.00 -0.03  0.22                                                
ni  -0.01 -0.02  0.05 -0.02  0.00  0.01 -0.05  0.08                                          
pb   0.02  0.00 -0.06 -0.02 -0.02 -0.05  0.01 -0.03  0.21                                    
zn   0.00  0.00 -0.05  0.01 -0.01 -0.01  0.00 -0.03 -0.02  0.10                              
ph  -0.03 -0.09  0.10 -0.01  0.02 -0.01 -0.05  0.07  0.07 -0.08  0.27                        
soc  0.02 -0.13  0.01  0.01  0.02  0.02  0.05  0.00 -0.04  0.00  0.00  0.19                  
n    0.03 -0.08 -0.01 -0.01  0.02  0.03  0.00  0.01 -0.05 -0.01  0.00 -0.07  0.15            
p   -0.04 -0.06 -0.08  0.05 -0.04 -0.05  0.00 -0.10  0.02  0.09 -0.28 -0.01 -0.02  0.69      
k   -0.03 -0.03 -0.03 -0.04 -0.02  0.04 -0.04  0.01 -0.02 -0.01  0.00  0.02  0.01 -0.03  0.17
factor.residuals(wu.cor, wu1.pca)
         ca      cd      cr      cu       fe      mg       mn       ni      pb       zn      ph     soc       n       p       k
ca   0.1154 -0.0596 -0.0207 -0.0045  1.9e-02  0.0113 -0.00659 -1.1e-02  0.0191 -0.00318 -0.0333  0.0189  0.0283 -0.0355 -0.0283
cd  -0.0596  0.3701 -0.0143 -0.0235 -3.7e-02 -0.0319  0.04783 -2.0e-02  0.0031  0.00157 -0.0878 -0.1257 -0.0794 -0.0573 -0.0272
cr  -0.0207 -0.0143  0.1719 -0.0020  3.2e-03 -0.0143 -0.06054  4.7e-02 -0.0565 -0.04674  0.0999  0.0097 -0.0117 -0.0845 -0.0338
cu  -0.0045 -0.0235 -0.0020  0.1021 -1.3e-02 -0.0104 -0.02526 -1.8e-02 -0.0186  0.01194 -0.0094  0.0111 -0.0104  0.0499 -0.0370
fe   0.0193 -0.0373  0.0032 -0.0128  5.7e-02  0.0070  0.00072  3.9e-05 -0.0173 -0.00612  0.0218  0.0195  0.0187 -0.0420 -0.0220
mg   0.0113 -0.0319 -0.0143 -0.0104  7.0e-03  0.0656 -0.02569  1.2e-02 -0.0500 -0.00546 -0.0137  0.0220  0.0277 -0.0450  0.0371
mn  -0.0066  0.0478 -0.0605 -0.0253  7.2e-04 -0.0257  0.21939 -4.9e-02  0.0134 -0.00032 -0.0499  0.0487 -0.0004  0.0025 -0.0389
ni  -0.0109 -0.0199  0.0467 -0.0178  3.9e-05  0.0119 -0.04943  8.4e-02 -0.0277 -0.03393  0.0741 -0.0013  0.0136 -0.1039  0.0080
pb   0.0191  0.0031 -0.0565 -0.0186 -1.7e-02 -0.0500  0.01337 -2.8e-02  0.2133 -0.02299  0.0723 -0.0415 -0.0545  0.0247 -0.0241
zn  -0.0032  0.0016 -0.0467  0.0119 -6.1e-03 -0.0055 -0.00032 -3.4e-02 -0.0230  0.09726 -0.0802  0.0018 -0.0077  0.0913 -0.0086
ph  -0.0333 -0.0878  0.0999 -0.0094  2.2e-02 -0.0137 -0.04989  7.4e-02  0.0723 -0.08021  0.2727  0.0019  0.0024 -0.2778 -0.0016
soc  0.0189 -0.1257  0.0097  0.0111  2.0e-02  0.0220  0.04871 -1.3e-03 -0.0415  0.00182  0.0019  0.1861 -0.0704 -0.0085  0.0209
n    0.0283 -0.0794 -0.0117 -0.0104  1.9e-02  0.0277 -0.00040  1.4e-02 -0.0545 -0.00774  0.0024 -0.0704  0.1550 -0.0249  0.0082
p   -0.0355 -0.0573 -0.0845  0.0499 -4.2e-02 -0.0450  0.00251 -1.0e-01  0.0247  0.09132 -0.2778 -0.0085 -0.0249  0.6896 -0.0331
k   -0.0283 -0.0272 -0.0338 -0.0370 -2.2e-02  0.0371 -0.03889  8.0e-03 -0.0241 -0.00856 -0.0016  0.0209  0.0082 -0.0331  0.1669
# get object residuals using mdaTools
# create datafile with just 8 variables
wumod <- wu[,c('ca','cd','cr','cu','fe','mg','mn','ni','pb','zn','ph','soc','n','p','k')]
wu1a.pca <- pca(wumod,ncomp=3, scale=TRUE, method="svd")
summary(wu1a.pca)

Factor analysis with Call: principal(r = r, nfactors = nfactors, residuals = residuals, 
    rotate = rotate, n.obs = n.obs, covar = covar, scores = scores, 
    missing = missing, impute = impute, oblique.scores = oblique.scores, 
    method = method, use = use, cor = cor, correct = 0.5, weight = NULL, 
    ncomp = 3, scale = TRUE)

Test of the hypothesis that 1 factor is sufficient.
The degrees of freedom for the model is 90  and the objective function was  5.4 
The number of observations was  300  with Chi Square =  1586  with prob <  7.2e-272 

The root mean square of the residuals (RMSA) is  0.14 
#plotResiduals(wu1a.pca, res=wu1a.pca$res)
#Can't work out plotResiduals command - not sure which package it's from

Try MultBiplotR package to get bootstrapped CIs

wu.pca.mult <- PCA.Analysis(wumod,dimension=3,Scaling=5)
summary(wu.pca.mult)
 ###### Principal Components Analysis #######

Transformation of the raw data:
[1] "Standardize columns"

 Eigenvalues & Explained Variance (Inertia)
     Eigenvalue Exp. Var Cummulative
[1,]       2562     57.1          57
[2,]        709     15.8          73
[3,]        327      7.3          80


 STRUCTURE OF THE PRINCIPAL COMPONENTS
     Dim 1  Dim 2  Dim 3
ca  -0.792  0.348 -0.370
cd  -0.607 -0.382 -0.340
cr  -0.856 -0.171  0.257
cu  -0.936 -0.045  0.138
fe  -0.947  0.003  0.215
mg  -0.957  0.137  0.021
mn  -0.804  0.355  0.087
ni  -0.945 -0.011  0.153
pb  -0.617 -0.559  0.307
zn  -0.945 -0.080 -0.052
ph  -0.488  0.272 -0.644
soc  0.075 -0.859 -0.264
n   -0.180 -0.885 -0.169
p   -0.487  0.076 -0.260
k   -0.908  0.090  0.026
wu.pca.boot <- PCA.Bootstrap(wumod,dimens=3,Scaling="Standardize columns", B=1000, type="np")
summary(wu.pca.boot)
 ###### Bootstrap for Principal Components Analysis #######

Transformation of the raw data:
[1] "Standardize columns"


Eigenvalues
       Initial Bootstrap Mean CI- P2.5 CI- P97.5 CI- M EI CI- M ES
Dim 1   2562.0         2567.2   2455.1      2684   2451.2     2683
Dim 2    709.2          714.5    656.7       783    651.8      777
Dim 3    327.0          333.2    292.0       384    286.8      380
Dim 4    270.8          266.6    235.5       296    236.6      297
Dim 5    148.4          148.5    124.1       175    122.4      175
Dim 6     94.9          100.7     86.1       118     84.8      117
Dim 7     90.6           86.7     74.3       100     73.2      100
Dim 8     73.9           71.9     61.7        83     61.4       82
Dim 9     64.0           60.3     50.9        70     50.6       70
Dim 10    47.1           45.1     36.2        54     36.5       54
Dim 11    32.8           31.5     24.7        39     24.4       39
Dim 12    22.5           21.2     15.8        29     14.5       28
Dim 13    17.5           16.2     13.1        20     12.7       20
Dim 14    14.9           12.7      9.0        16      9.2       16
Dim 15     9.6            8.7      6.6        11      6.7       11


Accounted Variance
       Initial Bootstrap Mean CI- P2.5 CI- P97.5 CI- M EI CI- M ES
Dim 1    57.12          57.24    54.74     59.84    54.65    59.83
Dim 2    15.81          15.93    14.64     17.45    14.53    17.33
Dim 3     7.29           7.43     6.51      8.57     6.39     8.46
Dim 4     6.04           5.95     5.25      6.60     5.28     6.62
Dim 5     3.31           3.31     2.77      3.91     2.73     3.89
Dim 6     2.12           2.25     1.92      2.63     1.89     2.60
Dim 7     2.02           1.93     1.66      2.24     1.63     2.24
Dim 8     1.65           1.60     1.38      1.84     1.37     1.84
Dim 9     1.43           1.34     1.13      1.56     1.13     1.56
Dim 10    1.05           1.01     0.81      1.19     0.81     1.20
Dim 11    0.73           0.70     0.55      0.86     0.55     0.86
Dim 12    0.50           0.47     0.35      0.65     0.32     0.62
Dim 13    0.39           0.36     0.29      0.45     0.28     0.44
Dim 14    0.33           0.28     0.20      0.36     0.20     0.36
Dim 15    0.21           0.19     0.15      0.24     0.15     0.24


Eigenvector Coefficients

Principal Component : 1 
    Initial Bootstrap Mean CI- P2.5 CI- P97.5 CI- M EI CI- M ES
ca   -0.270         -0.270   -0.288    -0.248   -0.290   -0.250
cd   -0.207         -0.207   -0.231    -0.177   -0.234   -0.180
cr   -0.292         -0.292   -0.300    -0.283   -0.301   -0.284
cu   -0.320         -0.320   -0.328    -0.311   -0.328   -0.311
fe   -0.324         -0.323   -0.329    -0.317   -0.330   -0.317
mg   -0.327         -0.327   -0.333    -0.320   -0.333   -0.320
mn   -0.275         -0.274   -0.287    -0.258   -0.289   -0.259
ni   -0.323         -0.322   -0.329    -0.316   -0.329   -0.316
pb   -0.211         -0.210   -0.235    -0.182   -0.238   -0.183
zn   -0.323         -0.323   -0.334    -0.312   -0.334   -0.312
ph   -0.167         -0.166   -0.193    -0.136   -0.195   -0.137
soc   0.026          0.026   -0.026     0.076   -0.026    0.078
n    -0.062         -0.061   -0.099    -0.018   -0.104   -0.018
p    -0.166         -0.167   -0.198    -0.134   -0.199   -0.135
k    -0.310         -0.310   -0.317    -0.304   -0.316   -0.304

Principal Component : 2 
    Initial Bootstrap Mean CI- P2.5 CI- P97.5 CI- M EI CI- M ES
ca    0.226          0.223    0.154     0.298    0.153    0.294
cd   -0.248         -0.246   -0.317    -0.173   -0.320   -0.171
cr   -0.111         -0.112   -0.159    -0.059   -0.164   -0.059
cu   -0.029         -0.028   -0.066     0.008   -0.066    0.009
fe    0.002          0.001   -0.037     0.041   -0.038    0.040
mg    0.089          0.089    0.061     0.121    0.058    0.119
mn    0.230          0.230    0.181     0.276    0.181    0.278
ni   -0.007         -0.009   -0.052     0.033   -0.051    0.034
pb   -0.363         -0.360   -0.406    -0.307   -0.410   -0.310
zn   -0.052         -0.052   -0.093    -0.017   -0.089   -0.014
ph    0.176          0.171    0.057     0.271    0.062    0.281
soc  -0.558         -0.554   -0.593    -0.514   -0.594   -0.514
n    -0.575         -0.572   -0.605    -0.534   -0.608   -0.535
p     0.050          0.054   -0.051     0.159   -0.054    0.161
k     0.058          0.058    0.020     0.096    0.020    0.096

Principal Component : 3 
    Initial Bootstrap Mean CI- P2.5 CI- P97.5 CI- M EI CI- M ES
ca   -0.354         -0.330   -0.400    -0.232   -0.415   -0.246
cd   -0.325         -0.299   -0.448    -0.128   -0.460   -0.138
cr    0.246          0.222    0.039     0.323    0.079    0.365
cu    0.132          0.125    0.050     0.181    0.060    0.190
fe    0.205          0.189    0.097     0.235    0.122    0.256
mg    0.020          0.015   -0.039     0.061   -0.035    0.065
mn    0.083          0.078   -0.015     0.163   -0.012    0.167
ni    0.146          0.128   -0.025     0.217    0.003    0.253
pb    0.293          0.280    0.179     0.379    0.176    0.384
zn   -0.050         -0.046   -0.174     0.075   -0.179    0.086
ph   -0.616         -0.590   -0.775    -0.307   -0.850   -0.331
soc  -0.252         -0.238   -0.348    -0.124   -0.346   -0.129
n    -0.161         -0.153   -0.249    -0.043   -0.253   -0.052
p    -0.249         -0.202   -0.632     0.406   -0.734    0.330
k     0.025          0.020   -0.037     0.076   -0.040    0.080


Correlations with the components

Principal Component : 1 
    Initial Bootstrap Mean CI- P2.5 CI- P97.5 CI- M EI CI- M ES
ca   -0.792         -0.792   -0.851    -0.720   -0.858   -0.725
cd   -0.607         -0.607   -0.686    -0.513   -0.692   -0.522
cr   -0.856         -0.856   -0.884    -0.824   -0.886   -0.826
cu   -0.936         -0.936   -0.955    -0.916   -0.956   -0.916
fe   -0.947         -0.947   -0.956    -0.936   -0.957   -0.937
mg   -0.957         -0.957   -0.966    -0.945   -0.967   -0.946
mn   -0.804         -0.803   -0.848    -0.747   -0.853   -0.753
ni   -0.945         -0.944   -0.961    -0.927   -0.962   -0.927
pb   -0.617         -0.616   -0.697    -0.528   -0.701   -0.531
zn   -0.945         -0.946   -0.974    -0.908   -0.981   -0.910
ph   -0.488         -0.486   -0.572    -0.393   -0.575   -0.398
soc   0.075          0.077   -0.075     0.222   -0.075    0.229
n    -0.180         -0.178   -0.291    -0.052   -0.305   -0.052
p    -0.487         -0.489   -0.582    -0.392   -0.585   -0.393
k    -0.908         -0.908   -0.925    -0.890   -0.926   -0.891

Principal Component : 2 
    Initial Bootstrap Mean CI- P2.5 CI- P97.5 CI- M EI CI- M ES
ca    0.348          0.346    0.233     0.472    0.228    0.464
cd   -0.382         -0.380   -0.497    -0.265   -0.498   -0.262
cr   -0.171         -0.173   -0.251    -0.090   -0.257   -0.089
cu   -0.045         -0.044   -0.104     0.012   -0.103    0.014
fe    0.003          0.002   -0.058     0.062   -0.058    0.062
mg    0.137          0.137    0.094     0.189    0.089    0.185
mn    0.355          0.355    0.276     0.426    0.279    0.430
ni   -0.011         -0.013   -0.081     0.050   -0.079    0.052
pb   -0.559         -0.557   -0.645    -0.460   -0.649   -0.465
zn   -0.080         -0.080   -0.143    -0.025   -0.138   -0.021
ph    0.272          0.266    0.087     0.430    0.090    0.441
soc  -0.859         -0.856   -0.897    -0.805   -0.899   -0.812
n    -0.885         -0.883   -0.913    -0.842   -0.918   -0.848
p     0.076          0.083   -0.078     0.246   -0.083    0.249
k     0.090          0.090    0.031     0.147    0.031    0.148

Principal Component : 3 
    Initial Bootstrap Mean CI- P2.5 CI- P97.5 CI- M EI CI- M ES
ca   -0.370         -0.349   -0.431    -0.241   -0.447   -0.251
cd   -0.340         -0.316   -0.475    -0.131   -0.490   -0.141
cr    0.257          0.235    0.040     0.351    0.080    0.391
cu    0.138          0.132    0.052     0.191    0.063    0.201
fe    0.215          0.200    0.099     0.254    0.125    0.275
mg    0.021          0.016   -0.041     0.066   -0.036    0.068
mn    0.087          0.081   -0.015     0.171   -0.011    0.174
ni    0.153          0.136   -0.025     0.234    0.002    0.270
pb    0.307          0.296    0.181     0.405    0.180    0.413
zn   -0.052         -0.050   -0.189     0.076   -0.191    0.091
ph   -0.644         -0.622   -0.801    -0.325   -0.887   -0.357
soc  -0.264         -0.251   -0.367    -0.130   -0.366   -0.135
n    -0.169         -0.161   -0.260    -0.047   -0.266   -0.055
p    -0.260         -0.215   -0.669     0.423   -0.772    0.342
k     0.026          0.021   -0.038     0.080   -0.041    0.084


Squared Correlations with the components

Principal Component : 1 
    Initial Bootstrap Mean CI- P2.5 CI- P97.5
ca    0.627          0.628    0.519     0.725
cd    0.369          0.370    0.263     0.471
cr    0.733          0.733    0.680     0.782
cu    0.877          0.876    0.838     0.911
fe    0.897          0.897    0.877     0.915
mg    0.915          0.915    0.893     0.933
mn    0.647          0.645    0.559     0.718
ni    0.892          0.892    0.859     0.923
pb    0.380          0.381    0.279     0.486
zn    0.894          0.895    0.825     0.949
ph    0.238          0.239    0.154     0.328
soc   0.006          0.012    0.000     0.049
n     0.033          0.036    0.003     0.085
p     0.237          0.242    0.153     0.339
k     0.824          0.825    0.792     0.855

Principal Component : 2 
    Initial Bootstrap Mean CI- P2.5 CI- P97.5
ca    0.121          0.123    0.055     0.223
cd    0.146          0.148    0.070     0.247
cr    0.029          0.032    0.008     0.063
cu    0.002          0.003    0.000     0.011
fe    0.000          0.001    0.000     0.005
mg    0.019          0.019    0.009     0.036
mn    0.126          0.127    0.076     0.181
ni    0.000          0.001    0.000     0.007
pb    0.312          0.313    0.211     0.416
zn    0.006          0.007    0.001     0.021
ph    0.074          0.079    0.008     0.185
soc   0.739          0.733    0.648     0.804
n     0.784          0.780    0.709     0.834
p     0.006          0.014    0.000     0.060
k     0.008          0.009    0.001     0.022

Principal Component : 3 
    Initial Bootstrap Mean CI- P2.5 CI- P97.5
ca    0.137          0.124    0.058     0.186
cd    0.115          0.108    0.017     0.226
cr    0.066          0.062    0.003     0.123
cu    0.019          0.019    0.003     0.037
fe    0.046          0.041    0.010     0.064
mg    0.000          0.001    0.000     0.004
mn    0.008          0.009    0.000     0.029
ni    0.023          0.023    0.000     0.055
pb    0.094          0.091    0.033     0.164
zn    0.003          0.008    0.000     0.036
ph    0.415          0.405    0.106     0.641
soc   0.070          0.066    0.017     0.135
n     0.028          0.029    0.002     0.067
p     0.068          0.127    0.000     0.449
k     0.001          0.001    0.000     0.007


Row Scores

Principal Component : 1 
       Initial Bootstrap Mean CI- P2.5 CI- P97.5 CI- M EI CI- M ES
  [1,]  -0.188         -0.188   -0.316    -0.065   -0.318   -0.059
  [2,]   5.197          5.192    5.152     5.230    5.152    5.232
  [3,]  -2.167         -2.164   -2.239    -2.078   -2.246   -2.083
  [4,]  -0.019         -0.017   -0.076     0.044   -0.079    0.044
  [5,]   6.087          6.079    5.979     6.159    5.983    6.175
  [6,]  -2.490         -2.488   -2.610    -2.359   -2.621   -2.355
  [7,]  -3.592         -3.588   -3.630    -3.537   -3.635   -3.541
  [8,]  -5.289         -5.287   -5.516    -5.015   -5.544   -5.030
  [9,]   6.083          6.077    6.038     6.109    6.041    6.113
 [10,]  -2.281         -2.278   -2.335    -2.211   -2.340   -2.215
 [11,]   2.619          2.617    2.421     2.812    2.416    2.818
 [12,]  -0.903         -0.902   -1.012    -0.791   -1.017   -0.786
 [13,]  -3.608         -3.605   -3.670    -3.541   -3.671   -3.540
 [14,]  -4.002         -3.998   -4.108    -3.877   -4.116   -3.881
 [15,]  -3.670         -3.667   -3.713    -3.614   -3.717   -3.618
 [16,]  -1.516         -1.513   -1.569    -1.462   -1.566   -1.460
 [17,]   5.914          5.907    5.849     5.951    5.853    5.961
 [18,]   2.340          2.337    2.127     2.544    2.125    2.550
 [19,]   6.124          6.117    6.071     6.156    6.074    6.159
 [20,]  -1.401         -1.397   -1.591    -1.189   -1.603   -1.192
 [21,]  -0.218         -0.216   -0.331    -0.095   -0.332   -0.100
 [22,]   5.652          5.645    5.607     5.677    5.609    5.681
 [23,]  -4.727         -4.723   -4.871    -4.570   -4.876   -4.570
 [24,]   2.807          2.802    2.653     2.934    2.653    2.952
 [25,]   5.401          5.396    5.337     5.456    5.335    5.457
 [26,]   4.999          4.991    4.828     5.128    4.836    5.145
 [27,]  -2.817         -2.815   -2.897    -2.727   -2.903   -2.726
 [28,]   2.483          2.479    2.362     2.589    2.365    2.594
 [29,]   0.125          0.126    0.033     0.218    0.031    0.221
 [30,]   5.355          5.348    5.280     5.402    5.289    5.408
 [31,]   1.891          1.887    1.788     1.971    1.797    1.977
 [32,]   3.019          3.015    2.891     3.116    2.898    3.131
 [33,]   1.251          1.251    1.136     1.372    1.128    1.373
 [34,]   3.364          3.359    3.310     3.403    3.311    3.408
 [35,]  -3.510         -3.505   -3.616    -3.361   -3.630   -3.380
 [36,]  -3.196         -3.192   -3.311    -3.060   -3.318   -3.067
 [37,]   5.662          5.658    5.505     5.801    5.509    5.807
 [38,]   6.157          6.150    6.063     6.225    6.068    6.233
 [39,]   3.361          3.357    3.270     3.434    3.274    3.441
 [40,]   4.465          4.460    4.364     4.546    4.366    4.554
 [41,]  -2.263         -2.262   -2.337    -2.183   -2.340   -2.184
 [42,]   5.831          5.824    5.762     5.871    5.767    5.881
 [43,]  -1.552         -1.551   -1.688    -1.408   -1.697   -1.406
 [44,]   5.488          5.484    5.343     5.616    5.344    5.623
 [45,]  -1.885         -1.882   -1.945    -1.820   -1.946   -1.819
 [46,]   4.965          4.959    4.892     5.013    4.899    5.020
 [47,]   6.125          6.119    6.090     6.143    6.092    6.145
 [48,]   6.409          6.401    6.330     6.451    6.338    6.464
 [49,]   5.532          5.526    5.416     5.622    5.420    5.631
 [50,]   4.235          4.231    4.128     4.327    4.131    4.332
 [51,]   4.053          4.047    3.967     4.127    3.968    4.126
 [52,]  -0.986         -0.983   -1.067    -0.887   -1.079   -0.888
 [53,]   6.549          6.543    6.453     6.617    6.459    6.627
 [54,]   5.907          5.897    5.787     6.013    5.784    6.011
 [55,]  -0.111         -0.110   -0.209    -0.008   -0.212   -0.008
 [56,]  -0.239         -0.237   -0.325    -0.144   -0.330   -0.145
 [57,]  -0.331         -0.331   -0.386    -0.282   -0.386   -0.277
 [58,]  -1.529         -1.526   -1.567    -1.490   -1.566   -1.487
 [59,]  -2.082         -2.078   -2.117    -2.034   -2.120   -2.035
 [60,]   3.739          3.735    3.700     3.763    3.703    3.766
 [61,]   5.999          5.993    5.868     6.102    5.870    6.116
 [62,]   2.532          2.530    2.385     2.672    2.384    2.677
 [63,]   5.221          5.212    5.095     5.304    5.109    5.316
 [64,]   5.254          5.250    5.155     5.338    5.158    5.342
 [65,]   5.304          5.298    5.209     5.375    5.212    5.384
 [66,]   4.727          4.721    4.675     4.757    4.679    4.763
 [67,]   0.193          0.193    0.125     0.259    0.125    0.260
 [68,]   5.667          5.661    5.605     5.701    5.611    5.710
 [69,]   5.267          5.261    5.213     5.296    5.219    5.303
 [70,]  -2.077         -2.077   -2.190    -1.965   -2.189   -1.965
 [71,]   4.773          4.765    4.683     4.854    4.678    4.853
 [72,]   5.101          5.094    4.974     5.202    4.978    5.210
 [73,]   6.840          6.831    6.651     6.995    6.651    7.011
 [74,]   4.767          4.763    4.658     4.861    4.659    4.867
 [75,]   2.958          2.956    2.731     3.200    2.720    3.192
 [76,]   5.873          5.868    5.746     5.978    5.749    5.987
 [77,]  -1.311         -1.310   -1.363    -1.255   -1.365   -1.255
 [78,]  -0.280         -0.280   -0.332    -0.226   -0.333   -0.226
 [79,]  -2.590         -2.589   -2.692    -2.484   -2.692   -2.487
 [80,]   1.732          1.731    1.687     1.778    1.686    1.777
 [81,]   6.093          6.085    6.014     6.154    6.012    6.157
 [82,]  -1.584         -1.580   -1.701    -1.444   -1.712   -1.448
 [83,]   3.108          3.104    2.945     3.253    2.946    3.263
 [84,]   5.148          5.142    5.083     5.185    5.090    5.194
 [85,]  -2.391         -2.389   -2.419    -2.358   -2.420   -2.358
 [86,]  -1.553         -1.548   -1.705    -1.374   -1.720   -1.376
 [87,]   1.607          1.604    1.544     1.660    1.544    1.664
 [88,]  -1.590         -1.590   -1.758    -1.428   -1.765   -1.416
 [89,]  -2.792         -2.787   -2.932    -2.646   -2.936   -2.639
 [90,]   3.966          3.962    3.876     4.042    3.880    4.045
 [91,]  -3.999         -3.996   -4.122    -3.853   -4.130   -3.861
 [92,]   0.625          0.623    0.516     0.728    0.514    0.732
 [93,]   5.880          5.873    5.843     5.898    5.845    5.902
 [94,]   5.143          5.135    5.025     5.222    5.033    5.236
 [95,]   3.321          3.316    3.284     3.345    3.284    3.347
 [96,]  -2.285         -2.283   -2.354    -2.207   -2.356   -2.210
 [97,]   3.231          3.227    3.079     3.364    3.082    3.372
 [98,]   4.144          4.138    3.789     4.476    3.786    4.490
 [99,]  -3.442         -3.436   -3.683    -3.174   -3.701   -3.172
[100,]  -2.062         -2.057   -2.123    -1.982   -2.127   -1.987
[101,]   3.315          3.313    3.154     3.473    3.151    3.475
[102,]  -1.611         -1.608   -1.689    -1.514   -1.696   -1.519
[103,]   4.330          4.326    4.233     4.410    4.232    4.419
[104,]   3.729          3.725    3.582     3.855    3.585    3.864
[105,]   0.932          0.929    0.874     0.981    0.875    0.983
[106,]   0.125          0.123    0.055     0.190    0.056    0.190
[107,]   0.590          0.590    0.536     0.642    0.537    0.644
[108,]   0.348          0.347    0.289     0.404    0.288    0.405
[109,]   4.662          4.657    4.574     4.740    4.576    4.737
[110,]  -0.358         -0.356   -0.455    -0.249   -0.460   -0.252
[111,]   0.246          0.247    0.158     0.339    0.156    0.338
[112,]  -0.940         -0.941   -1.158    -0.717   -1.171   -0.710
[113,]  -1.389         -1.385   -1.566    -1.184   -1.579   -1.190
[114,]  -2.619         -2.618   -2.854    -2.385   -2.855   -2.381
[115,]   0.300          0.300    0.170     0.433    0.165    0.434
[116,]   2.272          2.270    2.116     2.415    2.117    2.423
[117,]  -1.581         -1.578   -1.661    -1.484   -1.671   -1.485
[118,]   1.464          1.463    1.319     1.605    1.318    1.609
[119,]  -3.044         -3.044   -3.214    -2.876   -3.218   -2.869
[120,]  -3.865         -3.862   -3.951    -3.770   -3.958   -3.766
[121,]  -5.490         -5.484   -5.567    -5.392   -5.567   -5.402
[122,]  -3.184         -3.177   -3.333    -3.006   -3.346   -3.008
[123,]  -1.545         -1.540   -1.710    -1.352   -1.725   -1.356
[124,]  -5.185         -5.179   -5.239    -5.116   -5.244   -5.115
[125,]  -2.842         -2.841   -2.946    -2.745   -2.941   -2.742
[126,]   2.906          2.905    2.836     2.976    2.834    2.975
[127,]  -1.538         -1.535   -1.573    -1.495   -1.575   -1.496
[128,]  -2.542         -2.540   -2.620    -2.454   -2.624   -2.457
[129,]  -4.140         -4.131   -4.377    -3.871   -4.393   -3.869
[130,]  -0.697         -0.697   -0.829    -0.556   -0.832   -0.562
[131,]   1.136          1.135    1.061     1.212    1.057    1.213
[132,]  -1.944         -1.944   -2.074    -1.815   -2.074   -1.814
[133,]  -2.767         -2.763   -2.779    -2.743   -2.781   -2.744
[134,]   0.047          0.046   -0.065     0.146   -0.060    0.152
[135,]  -1.442         -1.442   -1.549    -1.340   -1.547   -1.337
[136,]  -0.163         -0.164   -0.227    -0.105   -0.226   -0.102
[137,]   0.658          0.657    0.571     0.750    0.567    0.746
[138,]  -0.488         -0.489   -0.540    -0.442   -0.538   -0.439
[139,]  -1.361         -1.360   -1.462    -1.255   -1.469   -1.251
[140,]  -2.743         -2.741   -2.823    -2.664   -2.818   -2.665
[141,]  -1.758         -1.753   -1.876    -1.613   -1.887   -1.619
[142,]  -1.225         -1.224   -1.242    -1.204   -1.243   -1.205
[143,]  -2.911         -2.908   -2.996    -2.819   -2.998   -2.819
[144,]   0.143          0.145    0.088     0.206    0.086    0.204
[145,]  -0.331         -0.330   -0.406    -0.251   -0.407   -0.253
[146,]  -3.222         -3.216   -3.297    -3.132   -3.297   -3.134
[147,]   1.642          1.641    1.574     1.706    1.575    1.707
[148,]  -2.456         -2.452   -2.521    -2.376   -2.526   -2.378
[149,]  -4.867         -4.864   -4.984    -4.735   -4.991   -4.736
[150,]  -0.564         -0.566   -0.655    -0.484   -0.651   -0.481
[151,]  -3.031         -3.028   -3.144    -2.903   -3.150   -2.905
[152,]  -2.927         -2.926   -3.054    -2.803   -3.056   -2.795
[153,]  -2.031         -2.030   -2.127    -1.941   -2.122   -1.939
[154,]  -2.167         -2.165   -2.226    -2.104   -2.226   -2.105
[155,]  -3.149         -3.146   -3.179    -3.112   -3.180   -3.112
[156,]  -1.418         -1.418   -1.546    -1.287   -1.554   -1.282
[157,]  -2.037         -2.035   -2.087    -1.987   -2.086   -1.985
[158,]   0.660          0.659    0.487     0.834    0.480    0.838
[159,]   1.372          1.372    1.289     1.450    1.288    1.455
[160,]  -0.597         -0.599   -0.677    -0.528   -0.674   -0.524
[161,]  -0.896         -0.895   -1.028    -0.742   -1.039   -0.751
[162,]  -0.260         -0.261   -0.436    -0.089   -0.441   -0.082
[163,]  -1.393         -1.390   -1.472    -1.301   -1.475   -1.306
[164,]  -1.321         -1.319   -1.411    -1.223   -1.416   -1.222
[165,]  -1.970         -1.970   -2.061    -1.882   -2.061   -1.878
[166,]   2.520          2.515    2.452     2.570    2.457    2.573
 [ reached getOption("max.print") -- omitted 134 rows ]

Principal Component : 2 
       Initial Bootstrap Mean CI- P2.5 CI- P97.5 CI- M EI CI- M ES
  [1,]   2.084          2.066    1.965     2.135    1.982    2.150
  [2,]   0.494          0.490    0.169     0.837    0.143    0.837
  [3,]  -0.858         -0.852   -0.996    -0.702   -1.001   -0.704
  [4,]  -0.491         -0.490   -0.599    -0.389   -0.596   -0.384
  [5,]   1.391          1.385    1.007     1.782    0.976    1.794
  [6,]   2.059          2.041    1.853     2.215    1.856    2.226
  [7,]  -0.059         -0.056   -0.357     0.221   -0.344    0.233
  [8,]  -1.151         -1.119   -2.024    -0.291   -2.018   -0.219
  [9,]   0.378          0.376   -0.004     0.788   -0.036    0.787
 [10,]  -0.551         -0.545   -0.766    -0.347   -0.756   -0.335
 [11,]   2.908          2.881    2.650     3.098    2.654    3.107
 [12,]   1.788          1.770    1.629     1.906    1.629    1.912
 [13,]   0.977          0.971    0.742     1.191    0.743    1.199
 [14,]   1.811          1.794    1.521     2.074    1.511    2.076
 [15,]   0.126          0.130   -0.167     0.412   -0.153    0.412
 [16,]  -0.222         -0.230   -0.443    -0.017   -0.447   -0.012
 [17,]   0.681          0.678    0.322     1.057    0.290    1.066
 [18,]   3.302          3.271    2.878     3.584    2.915    3.627
 [19,]   0.422          0.421    0.006     0.859   -0.015    0.857
 [20,]  -2.715         -2.700   -2.942    -2.438   -2.956   -2.443
 [21,]  -1.355         -1.350   -1.537    -1.162   -1.537   -1.162
 [22,]   0.416          0.419    0.047     0.832    0.014    0.823
 [23,]   2.055          2.035    1.711     2.351    1.703    2.367
 [24,]   2.487          2.472    2.290     2.653    2.288    2.656
 [25,]   0.200          0.196   -0.209     0.623   -0.215    0.606
 [26,]   1.737          1.732    1.370     2.082    1.369    2.096
 [27,]  -0.985         -0.972   -1.208    -0.737   -1.208   -0.735
 [28,]   1.567          1.560    1.373     1.729    1.383    1.737
 [29,]   1.372          1.358    1.160     1.556    1.158    1.558
 [30,]  -0.672         -0.663   -1.024    -0.283   -1.043   -0.283
 [31,]   1.076          1.079    0.842     1.295    0.844    1.315
 [32,]   1.881          1.875    1.629     2.106    1.636    2.114
 [33,]  -1.802         -1.791   -1.925    -1.645   -1.933   -1.648
 [34,]   0.531          0.527    0.300     0.764    0.289    0.766
 [35,]   1.702          1.678    1.174     2.198    1.143    2.213
 [36,]   2.121          2.100    1.839     2.370    1.826    2.374
 [37,]  -1.797         -1.786   -2.169    -1.361   -2.194   -1.378
 [38,]  -0.898         -0.890   -1.296    -0.466   -1.308   -0.472
 [39,]   1.305          1.297    1.064     1.539    1.057    1.536
 [40,]  -1.164         -1.150   -1.472    -0.813   -1.485   -0.814
 [41,]   1.055          1.048    0.854     1.232    0.858    1.238
 [42,]   0.707          0.703    0.341     1.073    0.317    1.088
 [43,]   2.163          2.143    1.990     2.289    1.990    2.297
 [44,]  -1.839         -1.827   -2.175    -1.439   -2.195   -1.458
 [45,]  -0.879         -0.874   -1.097    -0.619   -1.118   -0.630
 [46,]  -0.733         -0.724   -1.032    -0.388   -1.057   -0.390
 [47,]  -0.019         -0.019   -0.393     0.373   -0.410    0.373
 [48,]   1.045          1.044    0.638     1.467    0.607    1.481
 [49,]   1.337          1.325    0.960     1.696    0.951    1.698
 [50,]  -1.371         -1.358   -1.682    -1.027   -1.684   -1.032
 [51,]   0.444          0.449    0.147     0.745    0.142    0.756
 [52,]  -1.325         -1.319   -1.420    -1.206   -1.427   -1.210
 [53,]  -0.670         -0.663   -1.086    -0.191   -1.124   -0.201
 [54,]  -0.131         -0.111   -0.665     0.469   -0.695    0.473
 [55,]  -1.651         -1.640   -1.772    -1.475   -1.790   -1.491
 [56,]  -0.932         -0.927   -1.118    -0.726   -1.124   -0.730
 [57,]   0.842          0.840    0.769     0.910    0.768    0.912
 [58,]   0.207          0.200    0.022     0.388    0.011    0.389
 [59,]   0.338          0.331    0.132     0.521    0.131    0.530
 [60,]   0.043          0.043   -0.189     0.281   -0.199    0.286
 [61,]   1.780          1.766    1.398     2.145    1.382    2.150
 [62,]   1.877          1.856    1.604     2.102    1.607    2.106
 [63,]   1.249          1.249    0.836     1.656    0.840    1.658
 [64,]  -1.252         -1.242   -1.567    -0.891   -1.580   -0.904
 [65,]  -1.299         -1.285   -1.635    -0.920   -1.655   -0.915
 [66,]  -0.599         -0.590   -0.893    -0.273   -0.908   -0.272
 [67,]  -0.162         -0.166   -0.472     0.156   -0.493    0.162
 [68,]  -0.672         -0.663   -1.021    -0.299   -1.041   -0.284
 [69,]   0.533          0.534    0.187     0.877    0.184    0.885
 [70,]   1.007          1.005    0.717     1.315    0.701    1.309
 [71,]   0.014          0.031   -0.433     0.503   -0.447    0.509
 [72,]  -0.951         -0.931   -1.360    -0.473   -1.383   -0.480
 [73,]   2.504          2.484    2.048     2.943    2.030    2.938
 [74,]  -1.492         -1.481   -1.767    -1.176   -1.783   -1.180
 [75,]  -2.638         -2.616   -3.191    -2.046   -3.197   -2.035
 [76,]  -1.561         -1.551   -1.913    -1.156   -1.942   -1.159
 [77,]   0.524          0.524    0.378     0.656    0.382    0.666
 [78,]   0.551          0.544    0.414     0.681    0.408    0.680
 [79,]   0.749          0.749    0.442     1.078    0.431    1.068
 [80,]  -0.537         -0.535   -0.655    -0.399   -0.666   -0.404
 [81,]  -0.156         -0.143   -0.616     0.347   -0.636    0.350
 [82,]  -1.610         -1.602   -1.787    -1.402   -1.790   -1.415
 [83,]  -2.184         -2.160   -2.440    -1.854   -2.458   -1.862
 [84,]   0.692          0.688    0.376     1.016    0.354    1.022
 [85,]   0.190          0.189    0.018     0.349    0.023    0.355
 [86,]  -2.079         -2.069   -2.265    -1.862   -2.266   -1.873
 [87,]  -0.852         -0.843   -0.990    -0.686   -0.999   -0.687
 [88,]   2.552          2.535    2.427     2.631    2.430    2.641
 [89,]  -1.729         -1.714   -2.027    -1.398   -2.030   -1.398
 [90,]   1.110          1.097    0.823     1.382    0.809    1.386
 [91,]   1.986          1.967    1.594     2.342    1.583    2.351
 [92,]   1.136          1.123    0.878     1.373    0.870    1.376
 [93,]  -0.117         -0.111   -0.478     0.275   -0.504    0.282
 [94,]   1.376          1.375    0.975     1.739    0.988    1.763
 [95,]   0.114          0.120   -0.126     0.373   -0.136    0.377
 [96,]   0.619          0.611    0.340     0.888    0.336    0.886
 [97,]  -2.273         -2.252   -2.570    -1.933   -2.569   -1.934
 [98,]   5.477          5.434    5.034     5.772    5.061    5.808
 [99,]  -3.987         -3.961   -4.286    -3.627   -4.295   -3.627
[100,]   0.568          0.551    0.271     0.807    0.273    0.830
[101,]  -2.028         -2.016   -2.250    -1.752   -2.266   -1.765
[102,]  -1.054         -1.057   -1.264    -0.854   -1.268   -0.845
[103,]  -1.423         -1.413   -1.725    -1.110   -1.722   -1.103
[104,]  -2.092         -2.072   -2.410    -1.719   -2.423   -1.722
[105,]   0.312          0.319    0.138     0.507    0.125    0.513
[106,]  -0.512         -0.500   -0.700    -0.263   -0.726   -0.273
[107,]  -0.552         -0.552   -0.708    -0.404   -0.704   -0.399
[108,]   0.608          0.602    0.471     0.731    0.468    0.737
[109,]  -0.712         -0.698   -1.049    -0.340   -1.058   -0.337
[110,]  -1.400         -1.398   -1.553    -1.232   -1.560   -1.236
[111,]  -1.204         -1.201   -1.335    -1.063   -1.337   -1.065
[112,]   3.476          3.446    3.280     3.585    3.288    3.604
[113,]  -2.423         -2.412   -2.570    -2.237   -2.582   -2.241
[114,]   3.620          3.590    3.366     3.810    3.362    3.817
[115,]   1.770          1.752    1.596     1.880    1.607    1.897
[116,]  -2.195         -2.176   -2.379    -1.969   -2.383   -1.969
[117,]  -1.449         -1.442   -1.567    -1.316   -1.568   -1.315
[118,]  -2.374         -2.355   -2.607    -2.076   -2.623   -2.086
[119,]   2.046          2.029    1.744     2.298    1.749    2.309
[120,]   1.378          1.367    1.098     1.631    1.088    1.646
[121,]   0.432          0.429   -0.055     0.921   -0.070    0.928
[122,]  -2.206         -2.194   -2.424    -1.953   -2.430   -1.958
[123,]  -2.412         -2.405   -2.644    -2.158   -2.658   -2.152
[124,]   0.700          0.693    0.356     1.029    0.345    1.041
[125,]   1.094          1.093    0.856     1.333    0.852    1.334
[126,]  -1.037         -1.033   -1.218    -0.841   -1.226   -0.841
[127,]   0.620          0.614    0.490     0.735    0.489    0.739
[128,]  -0.496         -0.483   -0.750    -0.221   -0.750   -0.215
[129,]  -3.289         -3.276   -3.662    -2.827   -3.703   -2.849
[130,]   1.848          1.831    1.406     2.201    1.423    2.239
[131,]  -1.290         -1.281   -1.395    -1.167   -1.394   -1.169
[132,]   1.732          1.725    1.425     1.993    1.438    2.012
[133,]   0.052          0.048   -0.154     0.237   -0.157    0.253
[134,]   1.525          1.518    1.268     1.747    1.270    1.766
[135,]   1.252          1.249    1.016     1.483    1.014    1.484
[136,]  -0.462         -0.452   -0.638    -0.243   -0.652   -0.252
[137,]   1.341          1.331    0.988     1.617    1.014    1.647
[138,]  -0.303         -0.298   -0.429    -0.151   -0.438   -0.157
[139,]   1.654          1.641    1.526     1.745    1.530    1.752
[140,]  -0.360         -0.346   -0.633    -0.033   -0.652   -0.040
[141,]  -1.813         -1.808   -2.003    -1.605   -2.016   -1.600
[142,]   0.284          0.283    0.189     0.376    0.186    0.379
[143,]   1.264          1.254    1.030     1.467    1.029    1.479
[144,]  -0.278         -0.284   -0.456    -0.124   -0.452   -0.116
[145,]   0.860          0.848    0.702     0.982    0.705    0.991
[146,]  -0.168         -0.179   -0.517     0.179   -0.534    0.177
[147,]   0.721          0.710    0.546     0.870    0.549    0.872
[148,]  -1.172         -1.166   -1.347    -0.976   -1.357   -0.975
[149,]   1.544          1.538    1.203     1.865    1.199    1.876
[150,]   0.807          0.809    0.578     1.050    0.568    1.050
[151,]   1.837          1.820    1.581     2.051    1.578    2.061
[152,]   1.879          1.868    1.666     2.056    1.668    2.069
[153,]   1.145          1.142    0.935     1.358    0.935    1.350
[154,]   0.653          0.651    0.434     0.856    0.438    0.863
[155,]  -0.185         -0.182   -0.439     0.059   -0.432    0.068
[156,]   1.792          1.779    1.545     2.013    1.545    2.012
[157,]   0.211          0.215    0.000     0.443   -0.003    0.433
[158,]   2.512          2.487    2.303     2.648    2.311    2.663
[159,]  -1.298         -1.288   -1.415    -1.165   -1.413   -1.163
[160,]   0.934          0.935    0.767     1.102    0.768    1.102
[161,]   2.144          2.121    1.722     2.493    1.735    2.508
[162,]   2.675          2.653    2.490     2.774    2.508    2.798
[163,]   1.142          1.123    0.877     1.341    0.883    1.364
[164,]  -1.580         -1.570   -1.779    -1.324   -1.796   -1.345
[165,]   1.227          1.223    1.070     1.377    1.064    1.381
[166,]  -0.551         -0.540   -0.824    -0.257   -0.825   -0.256
 [ reached getOption("max.print") -- omitted 134 rows ]

Principal Component : 3 
       Initial Bootstrap Mean CI- P2.5 CI- P97.5 CI- M EI CI- M ES
  [1,]  -0.242         -0.256   -0.654     0.158   -0.668    0.157
  [2,]  -0.638         -0.608   -0.973    -0.169   -1.025   -0.192
  [3,]  -0.058         -0.065   -0.252     0.138   -0.264    0.134
  [4,]  -0.103         -0.123   -0.519     0.192   -0.477    0.232
  [5,]   0.335          0.318   -0.001     0.632   -0.002    0.638
  [6,]   0.525          0.458   -0.003     0.846    0.028    0.888
  [7,]  -1.087         -0.987   -1.432    -0.106   -1.665   -0.310
  [8,]  -3.749         -3.313   -6.455     1.557   -7.374    0.748
  [9,]  -0.771         -0.731   -1.077    -0.304   -1.127   -0.334
 [10,]  -0.913         -0.833   -1.138    -0.228   -1.298   -0.368
 [11,]   0.068          0.011   -1.035     0.985   -1.008    1.031
 [12,]   0.364          0.295   -0.395     0.798   -0.306    0.897
 [13,]  -0.304         -0.274   -0.678     0.248   -0.722    0.174
 [14,]  -0.584         -0.563   -0.870    -0.236   -0.887   -0.238
 [15,]  -0.424         -0.357   -0.926     0.546   -1.104    0.389
 [16,]   0.218          0.142   -0.916     0.922   -0.800    1.085
 [17,]  -0.070         -0.059   -0.296     0.188   -0.312    0.194
 [18,]  -2.015         -1.929   -2.633    -0.979   -2.813   -1.044
 [19,]  -1.378         -1.272   -1.541    -0.787   -1.632   -0.911
 [20,]  -1.681         -1.579   -2.006    -0.994   -2.104   -1.055
 [21,]  -1.180         -1.127   -1.479    -0.575   -1.600   -0.654
 [22,]  -0.939         -0.852   -1.212    -0.305   -1.315   -0.389
 [23,]  -0.529         -0.506   -0.863    -0.132   -0.879   -0.134
 [24,]  -0.125         -0.115   -0.512     0.253   -0.515    0.284
 [25,]  -1.574         -1.486   -1.892    -0.795   -2.087   -0.884
 [26,]   0.130          0.174   -0.463     0.883   -0.518    0.865
 [27,]  -0.388         -0.314   -1.031     0.685   -1.190    0.563
 [28,]   0.260          0.250   -0.096     0.561   -0.077    0.576
 [29,]   0.900          0.793   -0.093     1.377    0.028    1.557
 [30,]  -0.522         -0.463   -0.734    -0.071   -0.796   -0.130
 [31,]  -0.202         -0.124   -0.845     0.950   -1.038    0.790
 [32,]  -0.439         -0.370   -0.921     0.419   -1.055    0.315
 [33,]   0.553          0.497   -0.101     0.944   -0.031    1.025
 [34,]  -0.143         -0.149   -0.594     0.288   -0.591    0.292
 [35,]  -2.770         -2.630   -3.129    -1.904   -3.289   -1.972
 [36,]  -1.036         -1.001   -1.363    -0.559   -1.408   -0.595
 [37,]  -1.407         -1.329   -1.751    -0.683   -1.874   -0.784
 [38,]  -0.939         -0.870   -1.123    -0.552   -1.149   -0.591
 [39,]  -0.745         -0.699   -0.977    -0.379   -1.001   -0.396
 [40,]  -0.768         -0.671   -1.141     0.061   -1.289   -0.053
 [41,]   0.818          0.758    0.411     0.976    0.472    1.045
 [42,]   0.033          0.030   -0.275     0.307   -0.272    0.331
 [43,]   0.399          0.337   -0.239     0.796   -0.191    0.865
 [44,]  -0.898         -0.842   -1.196    -0.321   -1.275   -0.409
 [45,]   1.514          1.395    0.768     1.642    0.968    1.822
 [46,]  -0.246         -0.208   -0.468     0.067   -0.490    0.074
 [47,]  -0.481         -0.452   -0.756    -0.115   -0.793   -0.111
 [48,]  -0.421         -0.373   -0.778     0.072   -0.805    0.059
 [49,]   0.354          0.308   -0.464     0.890   -0.366    0.983
 [50,]  -1.012         -0.921   -1.214    -0.468   -1.290   -0.552
 [51,]  -0.111         -0.044   -0.535     0.655   -0.635    0.546
 [52,]   0.177          0.141   -0.294     0.467   -0.252    0.534
 [53,]  -1.337         -1.245   -1.535    -0.895   -1.577   -0.913
 [54,]  -0.876         -0.704   -2.169     1.319   -2.515    1.108
 [55,]   0.949          0.876    0.374     1.201    0.462    1.290
 [56,]  -0.723         -0.682   -1.108    -0.076   -1.205   -0.158
 [57,]   0.181          0.181   -0.108     0.462   -0.108    0.470
 [58,]   0.795          0.703   -0.090     1.109    0.086    1.320
 [59,]   0.500          0.433   -0.199     0.868   -0.110    0.977
 [60,]   0.210          0.194   -0.152     0.438   -0.099    0.488
 [61,]  -0.083         -0.096   -0.704     0.492   -0.686    0.495
 [62,]   0.847          0.741   -0.438     1.573   -0.277    1.759
 [63,]   0.411          0.429   -0.254     1.054   -0.250    1.109
 [64,]  -0.873         -0.805   -1.089    -0.405   -1.140   -0.470
 [65,]   0.495          0.487    0.171     0.750    0.194    0.779
 [66,]  -0.082         -0.045   -0.329     0.283   -0.361    0.272
 [67,]   2.191          2.005    0.784     2.436    1.142    2.867
 [68,]   0.422          0.412    0.179     0.627    0.176    0.648
 [69,]  -0.393         -0.339   -0.582    -0.001   -0.634   -0.045
 [70,]   1.927          1.817    1.234     2.099    1.342    2.291
 [71,]  -0.710         -0.564   -1.842     1.207   -2.150    1.022
 [72,]  -0.636         -0.528   -1.505     0.706   -1.663    0.607
 [73,]   0.122          0.090   -0.715     0.808   -0.668    0.849
 [74,]  -0.487         -0.451   -0.742    -0.062   -0.785   -0.117
 [75,]  -3.733         -3.449   -4.250    -1.894   -4.576   -2.322
 [76,]  -0.802         -0.753   -1.118    -0.244   -1.186   -0.319
 [77,]   0.387          0.377    0.081     0.630    0.096    0.657
 [78,]   0.769          0.691    0.073     1.010    0.209    1.174
 [79,]   1.938          1.830    1.227     2.137    1.331    2.329
 [80,]  -0.148         -0.153   -0.606     0.316   -0.620    0.315
 [81,]  -0.779         -0.662   -1.512     0.545   -1.714    0.391
 [82,]   0.706          0.626   -0.006     1.035    0.135    1.116
 [83,]  -0.211         -0.128   -1.002     0.842   -1.060    0.804
 [84,]  -0.262         -0.245   -0.502     0.042   -0.524    0.033
 [85,]   0.636          0.586    0.360     0.722    0.405    0.768
 [86,]   0.474          0.396   -0.385     0.934   -0.258    1.050
 [87,]   0.386          0.374    0.125     0.556    0.159    0.589
 [88,]   0.029          0.031   -0.357     0.377   -0.348    0.411
 [89,]  -1.537         -1.398   -1.988    -0.297   -2.267   -0.530
 [90,]  -0.617         -0.601   -1.118    -0.025   -1.181   -0.020
 [91,]  -1.806         -1.690   -2.033    -1.135   -2.137   -1.244
 [92,]   1.592          1.451    0.489     1.899    0.734    2.168
 [93,]  -0.002          0.020   -0.249     0.314   -0.273    0.314
 [94,]   0.810          0.786    0.297     1.182    0.327    1.245
 [95,]  -0.112         -0.072   -0.502     0.469   -0.568    0.424
 [96,]   1.682          1.541    0.791     1.848    1.010    2.072
 [97,]   1.311          1.257    0.698     1.671    0.779    1.735
 [98,]  -1.848         -1.742   -2.589    -0.853   -2.617   -0.867
 [99,]  -1.215         -1.111   -1.876    -0.291   -1.916   -0.306
[100,]  -0.456         -0.497   -1.560     0.421   -1.499    0.505
[101,]  -0.892         -0.848   -1.254    -0.314   -1.333   -0.364
[102,]   0.062          0.003   -0.973     0.733   -0.864    0.870
[103,]   0.690          0.639    0.133     0.955    0.230    1.047
[104,]   1.081          1.041    0.431     1.480    0.509    1.573
[105,]   0.044          0.087   -0.496     0.877   -0.620    0.794
[106,]   0.620          0.635   -0.143     1.428   -0.180    1.451
[107,]  -0.886         -0.837   -1.042    -0.510   -1.118   -0.555
[108,]   0.899          0.820    0.325     1.034    0.452    1.189
[109,]   0.447          0.483   -0.182     1.135   -0.212    1.179
[110,]  -0.006         -0.051   -0.933     0.683   -0.848    0.746
[111,]  -0.239         -0.256   -0.908     0.431   -0.924    0.412
[112,]   0.358          0.289   -0.448     0.945   -0.419    0.997
[113,]  -0.615         -0.612   -1.143    -0.020   -1.174   -0.049
[114,]  -0.414         -0.412   -1.006     0.190   -1.021    0.196
[115,]   0.079          0.036   -0.719     0.700   -0.707    0.779
[116,]  -0.576         -0.507   -0.965     0.056   -1.029    0.014
[117,]   0.156          0.132   -0.216     0.453   -0.213    0.478
[118,]   1.658          1.558    1.048     1.961    1.105    2.010
[119,]   1.541          1.424    0.869     1.797    0.965    1.883
[120,]  -0.705         -0.648   -0.948    -0.125   -1.037   -0.259
[121,]  -2.276         -2.099   -2.588    -1.063   -2.834   -1.364
[122,]  -0.147         -0.154   -0.506     0.239   -0.536    0.228
[123,]  -1.179         -1.145   -1.788    -0.300   -1.924   -0.365
[124,]  -0.430         -0.400   -0.718    -0.017   -0.745   -0.056
[125,]   0.711          0.703   -0.080     1.419   -0.072    1.478
[126,]  -0.198         -0.196   -0.679     0.321   -0.692    0.301
[127,]   0.244          0.212   -0.014     0.368    0.025    0.400
[128,]  -0.361         -0.273   -1.311     1.133   -1.506    0.960
[129,]  -1.970         -1.876   -2.460    -0.987   -2.622   -1.131
[130,]  -2.874         -2.681   -3.066    -1.870   -3.280   -2.081
[131,]   0.453          0.427    0.061     0.777    0.061    0.793
[132,]  -1.312         -1.175   -1.828     0.105   -2.146   -0.205
[133,]  -0.101         -0.110   -0.303     0.101   -0.317    0.098
[134,]  -1.404         -1.270   -1.724    -0.277   -2.000   -0.540
[135,]   1.423          1.345    0.721     1.677    0.840    1.850
[136,]   0.874          0.860    0.111     1.465    0.129    1.591
[137,]  -2.213         -2.056   -2.364    -1.353   -2.564   -1.548
[138,]   0.767          0.716    0.391     0.908    0.441    0.992
[139,]   0.084          0.061   -0.258     0.359   -0.257    0.378
[140,]   0.770          0.785   -0.329     1.944   -0.414    1.984
[141,]  -0.023         -0.060   -0.870     0.665   -0.832    0.712
[142,]   0.219          0.198    0.105     0.281    0.109    0.287
[143,]  -0.462         -0.429   -0.673    -0.158   -0.676   -0.183
[144,]   0.088          0.032   -0.872     0.722   -0.782    0.847
[145,]   0.509          0.439   -0.344     0.973   -0.232    1.109
[146,]  -1.520         -1.469   -1.993    -0.804   -2.114   -0.824
[147,]   0.118          0.078   -0.660     0.636   -0.561    0.717
[148,]   0.674          0.615    0.252     0.872    0.297    0.934
[149,]   0.379          0.390   -0.257     1.132   -0.314    1.094
[150,]   1.381          1.315    0.571     1.753    0.667    1.962
[151,]  -0.619         -0.594   -0.896    -0.243   -0.917   -0.271
[152,]   0.223          0.225   -0.292     0.738   -0.290    0.740
[153,]   0.937          0.893    0.202     1.342    0.296    1.490
[154,]   1.130          1.059    0.602     1.307    0.688    1.430
[155,]   1.020          0.959    0.585     1.196    0.628    1.291
[156,]   1.589          1.466    0.914     1.773    1.024    1.909
[157,]   1.138          1.075    0.548     1.353    0.629    1.521
[158,]   0.387          0.308   -0.672     1.097   -0.587    1.204
[159,]   0.391          0.385    0.089     0.639    0.102    0.669
[160,]   0.004          0.039   -0.796     0.952   -0.838    0.916
[161,]  -2.358         -2.215   -2.688    -1.605   -2.786   -1.645
[162,]  -0.817         -0.781   -1.202    -0.284   -1.245   -0.316
[163,]  -0.685         -0.695   -1.401    -0.003   -1.410    0.020
[164,]   1.465          1.356    0.712     1.694    0.893    1.820
[165,]   0.453          0.440    0.013     0.836    0.018    0.861
[166,]   1.147          1.110    0.488     1.516    0.543    1.676
 [ reached getOption("max.print") -- omitted 134 rows ]

Do biplots with scaling=1 (plot distances match euclidean dists - angles between variables irrelevant) and scaling=2

biplot(wu1.rda, scaling=1)

# now with scaling=2 - this is more useful
biplot(wu1.rda, scaling=2)

# try with ordiplot (default scale=2)
ordiplot(wu1.rda, choices=c(1,2), display='sites', type='none')

#points (wu1.rda, col = wu$group, pch = wu$group)
autoplot(wu1.rda, shape = wu$group,
         label = TRUE, label.size = 3,  loadings = TRUE,
         loadings.label = TRUE, loadings.label.size = 3, scale= 0
         ) +
#geom_point(data = wu1.rda,aes(RDA1,RDA2,colour = landuse),size=2,alpha=0.5)  
scale_shape_manual(values=c(0,1,2))+
  theme_qk()+
  theme(
    legend.title = element_blank()
  )

Try varimax rotation

principal(wu.cor, n.obs=300, nfactors=3, rotate="varimax")
Principal Components Analysis
Call: principal(r = wu.cor, nfactors = 3, rotate = "varimax", n.obs = 300)
Standardized loadings (pattern matrix) based upon correlation matrix

                       RC1  RC3  RC2
SS loadings           6.91 2.81 2.32
Proportion Var        0.46 0.19 0.15
Cumulative Var        0.46 0.65 0.80
Proportion Explained  0.57 0.23 0.19
Cumulative Proportion 0.57 0.81 1.00

Mean item complexity =  1.5
Test of the hypothesis that 3 components are sufficient.

The root mean square of the residuals (RMSR) is  0.05 
 with the empirical chi square  141  with prob <  6.2e-08 

Fit based upon off diagonal values = 0.99

Do PCA on covariance matrix

options(digits=10)
wu2.rda <- rda(wu[,c('ca','cd','cr','cu','fe','mg','mn','ni','pb','zn','ph','soc','n','p','k')],scale=FALSE)
summary(wu2.rda)

Call:
rda(X = wu[, c("ca", "cd", "cr", "cu", "fe", "mg", "mn", "ni",      "pb", "zn", "ph", "soc", "n", "p", "k")], scale = FALSE) 

Partitioning of variance:
               Inertia Proportion
Total         163243.5          1
Unconstrained 163243.5          1

Eigenvalues, and their contribution to the variance 

Importance of components:
                               PC1          PC2          PC3          PC4          PC5          PC6          PC7          PC8          PC9         PC10         PC11         PC12
Eigenvalue            7.571096e+04 6.145057e+04 2.589640e+04 1.392029e+02 3.397364e+01 5.4839052446 4.100869e+00 2.234922e+00 4.691284e-01 4.395120e-02 3.221747e-02 1.674771e-02
Proportion Explained  4.637916e-01 3.764350e-01 1.586366e-01 8.527314e-04 2.081163e-04 0.0000335934 2.512118e-05 1.369073e-05 2.873795e-06 2.692370e-07 1.973584e-07 1.025934e-07
Cumulative Proportion 4.637916e-01 8.402266e-01 9.988632e-01 9.997159e-01 9.999240e-01 0.9999576051 9.999827e-01 9.999964e-01 9.999993e-01 9.999996e-01 9.999998e-01 9.999999e-01
                              PC13         PC14         PC15
Eigenvalue            1.450067e-02 6.185779e-03 2.163316e-03
Proportion Explained  8.882845e-08 3.789295e-08 1.325208e-08
Cumulative Proportion 9.999999e-01 1.000000e+00 1.000000e+00

Scaling 2 for species and site scores
* Species are scaled proportional to eigenvalues
* Sites are unscaled: weighted dispersion equal on all dimensions
* General scaling constant of scores:  83.58469892 


Species scores

              PC1           PC2           PC3          PC4          PC5           PC6
ca   -0.038595809   0.002017012  -0.023045195  0.013473576  0.010415212 -0.0089143350
cd   -0.004510752  -0.006196526  -0.004868552  0.003126177  0.002106561  0.0008584689
cr   -0.856727213  -0.515659161  -1.199186325  1.339777180 -0.856488858  0.2072352642
cu   -0.740714876  -0.241886719  -0.596965607  0.590718444 -0.080309121 -0.1314547156
fe   -0.076060817  -0.019602987  -0.084885388  0.061504487 -0.012178313 -0.0099022818
mg   -0.053056126  -0.007411519  -0.047819584  0.036755088  0.001394533 -0.0150870233
mn  -28.786303812   7.776712046 -28.141684083 -0.198351098 -0.010234228  0.0022411978
ni   -0.773536414  -0.243422510  -0.936863446  0.843239387 -0.239651673 -0.4063610324
pb   -0.104549245  -0.230101578  -0.192721520  0.155868054 -0.062054647 -0.0173378963
zn   -2.539059988  -1.077063718  -1.705498417  1.738731426  0.807316492  0.0854777771
ph   -0.044874321   0.007909935  -0.047695277  0.032207264  0.015631342 -0.0319952870
soc   0.010787416  -0.030561482   0.001904923 -0.001202906  0.001803217  0.0064316153
n     8.300702078 -48.984613962  -8.499537365 -0.082620417 -0.004065831 -0.0006972253
p   -48.314881382 -12.975295430  15.442487151 -0.034257507 -0.016645512 -0.0009761853
k    -0.049899364  -0.008865460  -0.043332123  0.036497438  0.002939039 -0.0160148097


Site scores (weighted sums of species scores)

                PC1           PC2          PC3          PC4          PC5           PC6
sit1    -0.94400408  3.773480e+00  -1.76439295  -0.41746645  -0.47270326   3.714154925
sit2     7.12810312  3.405263e+00   4.26348270  -3.04171781   3.48018840  -2.929932112
sit3    -0.89175027 -4.613737e+00  -1.85667311   0.34450578  -0.78009093  -4.365783656
sit4     2.36368796 -1.783788e+00  -3.57019419  -2.77459486   2.98208089  -3.437762932
sit5     5.76224780  4.897179e+00   5.73767632  -4.52916358  -2.54103960   0.565732416
sit6    -4.14249846  4.932501e+00  -5.25962479  -0.45775227  -4.96763168   2.738444055
sit7    -7.24912676 -4.074143e-01   1.82598181   4.68930024   2.80995119   3.825020393
sit8   -28.29120560 -1.705824e+01  16.79485043   0.97223539  16.15123331   8.051866677
sit9     8.06171519  2.212666e+00   5.27513281  -4.42129642   0.05632804   1.524187445
sit10   -5.50558326 -3.058668e+00  -2.66767664  -5.35548584  -3.83565438  -1.606945586
sit11    4.06049528  9.468116e+00  -5.03514871  -6.53509041  -2.89060523   1.091713736
sit12   -1.25001938  4.311500e+00  -7.54977823  -4.10900353  -5.97012818   7.009068394
sit13   -7.03365067  1.308771e-04   1.03169638   3.55072451  -3.12050783   0.642926447
sit14   -6.79405102  3.717719e+00   0.06037381   5.12152566  -0.94409345  -5.061702768
sit15   -8.00156008 -2.310753e+00  -0.26708831   0.92952633   1.50242154  -5.563875325
sit16    4.01287220  8.944704e-01  -4.04070919   7.02862647  -0.57655089   2.246663779
sit17    6.67421844  2.203532e+00   7.09901166  -1.67530062  -0.09593925   1.526820894
sit18    1.70947484  8.431424e+00   3.31524798  -0.64535757   1.17825968  -4.381245496
sit19    5.95537503  1.072019e+00   7.93453745  -0.38334509  12.47868277   3.393627407
sit20    1.65340293 -6.072891e+00   0.87597934   4.58683963   4.05664940  -2.558732540
sit21    3.54373571 -3.297018e+00   0.18222138   3.59041492   3.90021925   0.183731287
sit22    3.74296662 -1.415208e-01   7.51661173  -7.89126538   1.49077240  -1.993531101
sit23   -6.83963044  5.430399e+00   1.01855587   8.45134918  -0.21553070  -4.239749374
sit24    0.29651104  7.039228e+00  -0.76175787  -8.08309327   6.97196732  -4.343624265
sit25    8.19606658  2.070644e+00   5.24031407  -2.76460366   6.80919100  -2.969224413
sit26    1.50127089 -5.611211e-01  10.13418170  -4.19457435  -0.67751484   1.105283546
sit27   -7.96253963 -3.672454e+00   1.47145277  -2.01922494  -2.71561163  -0.983118024
sit28    1.16389770  6.978437e+00  -1.63373086  -6.89273590   3.23211485  -3.124496261
sit29   -0.37504305  7.959023e+00 -16.24505726 -12.91464095  -2.68040355  10.178238313
sit30    4.46194934 -6.974331e-01   8.33621369  -2.44165721  -3.50517248   4.912405732
sit31   -4.55127608  5.175445e+00   3.90994191  -7.26864959  -0.19434867  -2.483644753
sit32   -3.06940612  4.533556e+00   0.86070494 -12.59765725   1.76177471  -1.302918142
sit33    6.33988690  1.382276e+00  -0.25159410   5.66314479   3.55454618   1.214528372
sit34    6.51376710  3.950077e+00   3.15454818   1.11024947   3.43016098  -5.744426199
sit35   -2.97476211 -7.755316e-01  -3.60869738   2.30716724   4.25250737   5.708409940
sit36   -5.22704122  3.619007e+00  -3.99092603   2.22699837   2.88756011   7.197129120
sit37    8.85859705 -2.472206e+00   2.16672701  -5.38543887  -0.18113197   2.700390233
sit38    8.02170932 -8.019171e-01   5.52828954  -4.62623244   1.52571818  -2.250349799
sit39    2.42986865  3.640993e+00   1.25474365  -6.17777103   1.15048303  -1.188524272
sit40    1.98181812 -3.902011e+00   7.57698646  -7.00319900  -0.58459724  -1.396315598
sit41   -2.94250632  3.234637e-01  -3.35829046   1.32397615   0.56222176   4.605764447
sit42    6.97982800  4.202494e+00   6.27720651   0.70354030   1.07002743   5.714833008
sit43   -1.40524558  4.441210e+00  -3.05860810   1.52207346  -0.93044488  -1.094236080
sit44    8.63738410 -1.104166e+00   3.25511075  -3.12982963   2.25678293   0.278320504
sit45    1.63737017 -3.230372e-01  -3.56092848   4.95912888   0.72269837  -1.376209299
sit46    5.09668457 -2.241898e+00   5.76590581  -5.53478079   1.62298733  -0.470246874
sit47    8.22181352  3.455444e-01   4.55537301  -4.41882348   1.75351134  -2.109844750
sit48    5.01453641  2.255101e+00   6.44580628  -7.24128522   4.53670521  -5.591312333
sit49    7.88444733  7.700660e+00   3.72667069   0.04051333  -2.45598770   2.607252512
sit50    4.71399659 -1.882806e+00   6.19365464  -1.59946916  -1.27870702  -6.207421810
sit51    0.31030600  3.311662e+00   7.85886887  -5.08497670  -0.10060391  -0.280076221
sit52    2.87123499 -3.110962e+00  -2.51424775   2.71244205   0.63744975   1.924097607
sit53    7.76116372 -3.026549e+00   5.40172238  -8.54126131   4.51265439  -6.133512372
sit54   -5.04960552 -1.532613e+00  16.75848626 -11.01366831  -7.39141903  -8.900442194
sit55    3.94479636 -2.267733e+00  -2.18907435   3.39878203  -2.88388194   0.290653824
sit56    0.85256554  1.188497e+00  -5.98930459  -5.88528588  -3.93798874   5.375613308
sit57   -2.08659775  2.434154e+00  -1.27806015  -3.05879268  -0.67463138  -2.537761613
sit58    1.14428256  2.834404e+00  -6.73635922   0.61603341  -1.43811509   1.206529600
sit59   -1.24840102  4.060297e+00 -10.14550014  -4.61534846  -2.75975095   1.391438524
sit60    7.22987786  1.996104e+00   3.92363015   1.34325793   3.39440295  -2.845798744
sit61    5.91805661  6.727347e+00   0.22806373  -8.44335231  -4.27867861   4.577727297
sit62    4.64429200  7.775898e+00  -4.70310045  -3.87313396  -5.61330501   5.374162345
sit63    0.42810092  4.079249e+00  10.62445315  -1.56269283  -3.03373399   7.194678734
sit64    7.62904036 -3.215508e+00   3.22091059  -7.51124171   4.19533853  -7.803525778
sit65    5.99878520  5.863825e-02   6.38545900  -1.32169784  -2.94137634   0.648290815
sit66    3.88126984  1.269153e-01   5.86626490  -3.99387009  -0.22589286   0.862023702
sit67    5.62707308  4.554700e+00  -0.76542243  10.26423207  -3.10337156  -1.790562995
sit68    6.67751547 -9.363147e-01   3.24589298  -5.50984147  -1.35734207   3.912371543
sit69    2.44282602  3.301933e+00   4.29446871  -8.89701122  -0.27411438  -1.239640684
sit70   -3.62284988  2.134387e+00  -0.20646786   3.37804761  -4.03087161  -0.156738787
sit71   -4.38834966 -2.001894e+00  11.98634113  -9.85464949   1.76740031  -3.592164243
sit72   -0.52006523 -2.188123e+00  11.90399767  -5.65258320  -0.65916734  -6.955002715
sit73    8.54863454  8.519421e+00   5.96873050  -1.69542712  -2.98654410   1.337742300
sit74    8.09245966 -2.454889e+00   3.00586015  -3.67552639   2.90753760   1.592474733
sit75    2.72864203 -3.471041e+00   5.15632039   9.89415925  37.39226777  25.208386430
sit76    8.85017631 -9.294983e-01   4.40899331  -4.14797488  -1.18905647   1.702885042
sit77   -3.02021203  2.206462e+00  -3.77809767  -3.83680327   1.35464858  -0.090837591
sit78    2.05124337  4.328263e+00  -0.45867685   5.46801444  -2.84341528   2.056135870
sit79   -4.19051030  3.921692e+00   2.32167616   8.66850104  -1.05770460  -6.220423323
sit80    5.59779363 -1.408260e+00  -0.99440226  -2.00927573   1.15340039  -3.985426208
sit81    0.50927552 -1.474616e+00  12.18252444  -7.67216482  -1.97099198  -4.306514371
sit82    1.30300721 -4.203744e+00  -8.22031757  -2.96151347  -3.94806809   3.738961581
sit83   -0.64600738 -3.394079e+00   9.21547867  -2.73427817   3.01324484  -1.944164794
sit84    6.35410815  2.097650e+00   4.65456071  -2.77128252  -0.22468937   1.182858963
sit85   -2.76616870  6.912688e-01  -1.04478673   4.89079844  -2.46313522   4.242745473
sit86    2.36663683 -4.426619e+00  -9.70408278  -3.48470900  -3.36941498   2.539562061
sit87    1.88998826  1.371701e+00   5.86601170   5.95239302  -5.62506425   4.360616243
sit88   -5.60795328  5.733305e+00   0.67891813  -0.13519362  -3.60950529  -3.384310712
sit89   -7.63007307 -8.941354e+00  -2.82510831  -7.38794227   1.54989462   4.110989985
sit90    5.28537380  5.272665e+00   4.32634087   0.68744803   0.06876096  -0.445856547
sit91   -7.88242918  1.001794e+00   1.82915338   2.63289449  -6.74960197   0.456594317
sit92    4.10302921  5.618652e+00   1.54300090   9.38484943  -6.06948965   3.831178403
sit93    5.57177995 -1.885259e+00   5.84706794  -7.66654607  -5.37042123  -3.609667410
sit94    2.92561205  6.675291e+00   6.07257596  -3.66068487   5.02396403  -3.576831561
sit95    1.94586015  2.106037e+00   7.68036531   1.42872441   6.54520425  -2.769951010
sit96   -0.49808631  4.470891e+00  -2.60245899   7.77208943  -6.60778160  -0.578866318
sit97    4.64518969 -1.642112e+00   6.37593129   2.73732673  -1.56885753   6.797707946
sit98    0.74599976  9.993016e+00   2.91143724  -8.63537118   2.73592540  -8.962607850
sit99   -2.57958792 -8.054651e+00   1.43689641   8.44042829 -11.24740521  21.122687382
sit100   0.34913853  2.856389e+00  -8.73868353  -1.02419290  -6.50794959   6.725395433
sit101   7.40055013 -2.634213e+00   0.89557346  -2.62063062   2.06357839  -2.710160413
sit102   3.67130391 -1.425269e+00  -3.96245503   4.91735320  -0.33602523  -0.300049697
sit103   7.65299059  8.426549e-01   2.36491055  -0.23928855  -1.30263229   4.108863393
sit104   3.64304150 -1.931374e+00   8.57502829   4.89712467  -3.68596369   3.285568273
sit105  -2.97878536  3.154124e+00   2.85610764  -3.12060076  -3.60562490   5.563464894
sit106  -4.55045810  3.465598e-01   5.23325066   0.58739597 -13.28971973  16.018108964
sit107   1.59850875 -1.241140e-01   6.08559240   5.66604701  -2.77152475   2.791351068
sit108   2.48335421  2.550372e+00  -1.48625148   3.03675132   0.41466872   1.658532890
sit109   0.68483638  9.179919e-01   7.74093194  -8.07314933   0.78526552  -2.501066734
sit110   5.79442318 -5.281686e-01  -0.98273327   7.76622513   3.45438053  -1.538344967
sit111   4.86551579  2.234323e+00   0.54409214   7.78734184   0.21183294   5.445283062
sit112  -0.17919456  7.940351e+00  -0.09829515   6.22860435   5.87974274  -3.645556051
sit113   3.03913945 -3.952963e+00  -4.74568851   2.59595700   4.47671333   2.843439266
sit114  -6.18833175  5.606211e+00   4.81825648   5.09912578  -4.50826670  -4.124700245
sit115   3.08377129  7.494871e+00  -0.63934146   4.98842369   4.65687197  -0.356229142
sit116   2.00566852 -4.049232e+00   5.73600358   1.07131765  -2.25181981   3.958978550
sit117   1.13220888 -2.866338e+00  -2.72021040   3.22489875  -2.66115186   6.060399040
sit118   4.57912856 -4.024015e+00   1.71827714   3.13498889  -4.14078971   6.738476206
sit119  -3.13104691  6.769687e+00   4.91842646  16.14157286  -1.22957728  -2.475913522
sit120  -8.07683128  1.222182e+00  -0.29110444   1.22385025  -1.31881207  -0.232926973
sit121 -11.21509940 -1.832202e+00  -0.17631072  -2.37649646  -4.11063506   0.425811795
sit122  -2.08834534 -6.606797e+00  -9.09238970  -5.72597583  -3.06252100  -3.503581266
sit123   3.77404315 -5.410029e+00  -2.29633592   4.65240062   1.45361837  -1.021700691
sit124  -7.42373724  2.640843e+00  -2.74452854   7.91411446   4.85915561   7.812236504
sit125  -7.28938871  1.797515e+00   2.73158520   4.40636729  -0.90597698  -3.130149689
sit126   7.19909606 -4.146972e-01   2.20964114   1.21178757   4.51056615   0.455780317
sit127  -1.49343984  1.832788e+00  -5.45624265  -2.17539527   4.21463971  -3.975384441
sit128  -9.46103701 -3.129882e+00   3.74830099  -1.56197387  -3.26880197   0.736958643
sit129  -1.61307291 -1.076661e+01  -7.42438086  -2.85540737  -4.82055713   5.765134176
sit130  -5.82578864  2.747779e+00   6.93885901   0.50786585  -7.37969737  -2.656352869
sit131   4.38587580 -5.135676e-01   0.80488145   1.47380713   4.69218546   3.590649678
sit132  -7.63234215  9.687229e-01   5.17975660   2.25926746   4.99033359  -1.292400198
sit133  -2.71057500 -8.778285e-01  -6.55600594  -2.91326012   0.07221249  -2.302950359
sit134  -6.87088036  2.028777e+00   0.59980502  -9.33047411  -2.16646192   4.714909211
sit135  -3.65782711  3.777912e+00  -1.49621114   1.48592214   1.73155445   0.662497154
sit136  -2.47324828 -1.966473e+00   3.06745514  -0.45249868  -0.93750219  -3.447633728
sit137  -3.30192382 -1.493308e-01   2.63197252  -6.50920556   3.46113143  -2.727970159
sit138   0.68611161 -1.696355e+00  -1.11921197   2.69348900   5.09462420   0.639876833
sit139  -1.93824889  5.364167e+00  -2.73364168   0.20952354   1.78689220  -5.094999456
sit140  -8.79368735 -3.238373e+00   0.64808716  -1.68936346  -0.91760980   4.443940511
sit141   2.85322273 -2.103228e+00  -4.85502143   1.22909046   0.78940851  -6.590790349
sit142  -1.01282815  6.631129e-01  -3.92384004  -1.39143817   3.57336007  -1.668878528
sit143  -6.13031558  3.413502e+00  -3.04086867  -1.34335500  -1.54451307  -1.356256765
sit144   3.97778311  2.312375e+00  -5.03985473   0.14918836   0.87226811   0.852777495
sit145   2.51474683  5.164018e+00  -4.52025420   1.84812037   3.83475073   0.324389741
sit146  -2.67116378 -1.100875e+00  -2.37446665   3.47064018  -2.09344287  -7.975524267
sit147   4.50036125  3.922543e+00  -0.76649607   0.42078446   6.05885168  -4.394951587
sit148   0.15397303 -1.711395e+00  -4.05748850   3.91347849   0.58376215   4.057371241
sit149 -11.08970653  2.660360e+00  -0.76241272   0.75396698  -4.92437012  -2.550028808
sit150  -3.44671526  2.601541e+00   1.20992178   1.41817822  -3.65346820   6.070382635
sit151  -5.26647049  3.353702e+00  -2.97338399  -0.86035011  -3.93346648   0.214856314
sit152  -7.57931111  3.105931e+00  -0.35028279   0.82948545  -3.39699802   3.158238733
sit153  -4.87833526  1.700532e+00  -0.45678694   2.59260902   2.77447488   1.534697846
sit154  -4.36128494  2.377166e+00  -3.39642898   0.70978199  -0.23242297  -2.019306910
sit155  -3.28446948  8.136850e-01  -3.54663391   5.27699674   5.40403406  -3.326022354
sit156  -1.64209209  7.957919e+00  -5.42067190   0.74681315  -1.14972180   1.968235264
sit157  -3.17175691  1.915948e+00  -2.07255098   3.05793287   4.56613213  -2.584028870
sit158   3.04884112  7.799896e+00  -1.03715780   4.68844364  -0.69708367   5.280793723
sit159  -0.06020073 -2.540949e+00  -2.98152173  -6.67482537  -4.29674713  11.503972289
sit160  -5.21288132 -5.328755e-01   3.01391937   0.52514056   3.18921573   3.351058586
sit161  -4.30170105  2.693235e+00   4.33621051   2.86132228   1.87127883   4.456855629
sit162  -1.26798292  5.854461e+00   1.93247619   1.29583539   1.17093528  -3.217325581
sit163  -0.51033130  1.616064e+00  -2.96427251   1.71850283  -2.00899657   5.555637409
sit164   3.46770661 -2.975760e+00  -3.65774179   4.23471230   4.82406344  -4.606390289
sit165  -4.43944295  4.328100e+00   0.22671581   2.98499767   0.73921126  -1.881616261
sit166   1.68558343 -2.366311e+00   6.41854873   1.00352615  -0.98598125   5.118569477
 [ reached getOption("max.print") -- omitted 134 rows ]
scores(wu2.rda, choices=c(1:2), display='species', scaling = 0)
                 PC1              PC2
ca  -6.780347384e-04  0.0000393311470
cd  -7.924296995e-05 -0.0001208304870
cr  -1.505061899e-02 -0.0100552056778
cu  -1.301256365e-02 -0.0047167216016
fe  -1.336204061e-03 -0.0003822526200
mg  -9.320674429e-04 -0.0001445224866
mn  -5.057055320e-01  0.1516436533552
ni  -1.358915845e-02 -0.0047466690877
pb  -1.836676627e-03 -0.0044869147439
zn  -4.460512507e-02 -0.0210024334415
ph  -7.883329614e-04  0.0001542414662
soc  1.895087365e-04 -0.0005959401288
n    1.458232008e-01 -0.9551859159818
p   -8.487752702e-01 -0.2530145375865
k   -8.766107829e-04 -0.0001728739345
attr(,"const")
[1] 83.58469892
wu2.cov <- cov(wu[,c('ca','cd','cr','cu','fe','mg','mn','ni','pb','zn','ph','soc','n','p','k')])
wu2.vec <- eigen(wu2.cov)
print(wu2.vec)
eigen() decomposition
$values
 [1] 7.571096416e+04 6.145057283e+04 2.589639838e+04 1.392028752e+02 3.397363594e+01 5.483905245e+00 4.100869117e+00 2.234922443e+00 4.691284042e-01 4.395119845e-02 3.221747328e-02
[12] 1.674770957e-02 1.450066788e-02 6.185779103e-03 2.163315794e-03

$vectors
                  [,1]             [,2]             [,3]             [,4]            [,5]            [,6]             [,7]             [,8]             [,9]            [,10]
 [1,] -6.780347384e-04  0.0000393311470 -6.922323577e-04 -0.0055201384769 -0.008637504172 -0.018400734874 -0.0159564304042  4.011773460e-02  0.1305127770191  2.358755549e-01
 [2,] -7.924296995e-05 -0.0001208304870 -1.462417343e-04 -0.0012807979215 -0.001747005622  0.001772028899 -0.0018347739091 -2.059612034e-03  0.0156931091544 -5.064962310e-02
 [3,] -1.505061899e-02 -0.0100552056778 -3.602119960e-02 -0.5489081279879  0.710300125573  0.427769559371 -0.0869096303802  3.851289227e-02  0.0181713634362  8.838008219e-05
 [4,] -1.301256365e-02 -0.0047167216016 -1.793167321e-02 -0.2420179714088  0.066601659012 -0.271345352274  0.8813569536956  2.921626930e-01  0.0170453778822 -1.524475172e-02
 [5,] -1.336204061e-03 -0.0003822526200 -2.549790169e-03 -0.0251984533206  0.010099672729 -0.020440028621  0.0099304023521 -1.999311944e-02 -0.0423233347599  6.484384812e-01
 [6,] -9.320674429e-04 -0.0001445224866 -1.436406292e-03 -0.0150585984553 -0.001156509173 -0.031142235151 -0.0096317468330  2.913024508e-02  0.0103792938220  4.226873791e-01
 [7,] -5.057055320e-01  0.1516436533552 -8.453208633e-01  0.0812646548203  0.008487411819  0.004626221351 -0.0007583159275 -3.178455173e-05 -0.0002333980917 -7.564578423e-04
 [8,] -1.358915845e-02 -0.0047466690877 -2.814153605e-02 -0.3454760689039  0.198747026207 -0.838799711269 -0.3506505149522 -5.302457207e-02 -0.0852221187215 -5.716368926e-02
 [9,] -1.836676627e-03 -0.0044869147439 -5.788975566e-03 -0.0638593067061  0.051462927041 -0.035788427564  0.2759393484783 -9.401657809e-01  0.1739608118648  6.904731426e-03
[10,] -4.460512507e-02 -0.0210024334415 -5.122981944e-02 -0.7123601047660 -0.669520683779  0.176440969973 -0.0852477173324 -2.186209393e-02 -0.0122617810759 -1.315322146e-02
[11,] -7.883329614e-04  0.0001542414662 -1.432672367e-03 -0.0131953502934 -0.012963326168 -0.066043826483 -0.0922486956409  1.515183271e-01  0.9701824184362 -2.324956255e-02
[12,]  1.895087365e-04 -0.0005959401288  5.722013896e-05  0.0004928320011 -0.001495437496  0.013275970414  0.0046255468439 -1.093413057e-02  0.0283924050635 -9.582187349e-02
[13,]  1.458232008e-01 -0.9551859159818 -2.553093924e-01  0.0338496721198  0.003371859736 -0.001439194051 -0.0007160643053  3.524707653e-03 -0.0003262974029  1.304962481e-04
[14,] -8.487752702e-01 -0.2530145375865  4.638619541e-01  0.0140353368876  0.013804393695 -0.002015015930 -0.0020326868554 -6.829477905e-04  0.0001643318138  3.569687377e-05
[15,] -8.766107829e-04 -0.0001728739345 -1.301611791e-03 -0.0149530389631 -0.002437392592 -0.033057347255 -0.0174745727206  2.060489139e-03  0.0215554420365  5.737739186e-01
                 [,11]            [,12]            [,13]            [,14]            [,15]
 [1,] -1.967939307e-01 -1.699015767e-01  8.346082617e-01  4.009859122e-01  8.089636071e-03
 [2,]  4.738591046e-02 -2.816733390e-02  4.489474736e-02 -3.719673071e-02 -9.953566700e-01
 [3,]  9.034391699e-03 -7.394632329e-03  7.485152402e-03 -3.016392388e-04  1.579653034e-03
 [4,]  1.088840372e-02  1.539260159e-04 -3.171003423e-03  6.896408113e-03 -1.355741514e-03
 [5,] -6.208595497e-01  2.367463734e-01 -3.331867805e-01  1.245687870e-01 -8.960190514e-02
 [6,]  9.451563508e-02 -3.074178863e-02  2.995617868e-01 -8.477150543e-01  2.913893056e-02
 [7,]  3.979922668e-04  4.317341913e-05 -4.942104195e-05 -6.762849016e-06  8.684583702e-05
 [8,] -8.321352464e-03  1.044582145e-02  2.450526407e-03  8.919442482e-03  1.492029271e-05
 [9,]  7.825257403e-03 -2.323375499e-02  2.560221914e-02 -1.649040214e-02  6.558844379e-03
[10,] -8.146214549e-04 -2.923190107e-03 -3.417863249e-03 -3.555415865e-04  3.000938631e-03
[11,] -2.529287701e-02  1.156160917e-02 -1.390153008e-01 -4.279578894e-02  1.005603045e-02
[12,]  1.365906761e-01  9.551093570e-01  2.418058396e-01  1.751827917e-02 -4.910526986e-03
[13,] -4.106224541e-05 -4.984473670e-04 -1.236519108e-04  4.486936135e-05  7.695672455e-05
[14,] -9.427321886e-05  7.283065175e-05 -1.295317331e-04 -4.394197649e-05 -2.055602416e-05
[15,]  7.382402769e-01 -1.631473288e-02 -1.487555736e-01  3.180422365e-01 -1.185200857e-02
# get true loadings as correlations
wu2.load <- eigen.loadings(wu2.vec)
print(wu2.load)
                  [,1]             [,2]             [,3]            [,4]            [,5]            [,6]            [,7]             [,8]             [,9]            [,10]
 [1,]   -0.18656549874  9.749886941e-03   -0.11139650872 -0.065128949812 -0.050345340726 -0.043090361635 -0.032312733340  5.997463717e-02  0.0893920496079  4.945022770e-02
 [2,]   -0.02180419877 -2.995294256e-02   -0.02353374333 -0.015111400538 -0.010182755519  0.004149691118 -0.003715527757 -3.079049346e-03  0.0107486732263 -1.061846106e-02
 [3,]   -4.14127194335 -2.492607666e+00   -5.79666037095 -6.476252374556  4.140119776314  1.001739611808 -0.175997239984  5.757545293e-02  0.0124461026639  1.852847868e-05
 [4,]   -3.58048826931 -1.169238780e+00   -2.88562903548 -2.855431322846  0.388200474252 -0.635429478088  1.784800954882  4.367732047e-01  0.0116748819544 -3.195992244e-03
 [5,]   -0.36766490415 -9.475746608e-02   -0.41032136044 -0.297302107278  0.058867869077 -0.047865926612  0.020109663316 -2.988902779e-02 -0.0289885000292  1.359421520e-01
 [6,]   -0.25646418614 -3.582600589e-02   -0.23115164191 -0.177667771765 -0.006740934327 -0.072928075100 -0.019504867889  4.354871722e-02  0.0071090844086  8.861446942e-02
 [7,] -139.14803985809  3.759128803e+01 -136.03205900011  0.958795082296  0.049470498819  0.010833564658 -0.001535635460 -4.751681462e-05 -0.0001598612356 -1.585879154e-04
 [8,]   -3.73914193411 -1.176662530e+00   -4.52863670922 -4.076074114246  1.158434954549 -1.964279315214 -0.710088428182 -7.926991648e-02 -0.0583711421858 -1.198410514e-02
 [9,]   -0.50537306064 -1.112271439e+00   -0.93158266871 -0.753439356435  0.299961487150 -0.083808407471  0.558793812868 -1.405515594e+00  0.1191508898916  1.447545259e-03
[10,]  -12.27337912799 -5.206340703e+00   -8.24408591228 -8.404728559842 -3.902429020871  0.413184867636 -0.172631765891 -3.268308054e-02 -0.0083984554406 -2.757512522e-03
[11,]   -0.21691474462  3.823526572e-02   -0.23055076528 -0.155684374694 -0.075559219409 -0.154659712582 -0.186809168948  2.265147019e-01  0.6645065476220 -4.874164101e-03
[12,]    0.05214451404 -1.477289457e-01    0.00920806957  0.005814642296 -0.008716442710  0.031089321709  0.009367011163 -1.634615016e-02  0.0194467954777 -2.008861607e-02
[13,]   40.12416568566 -2.367831959e+02  -41.08530125198  0.399372879114  0.019653527676 -0.003370267140 -0.001450073379  5.269317042e-03 -0.0002234907133  2.735793959e-05
[14,] -233.54582388473 -6.272034567e+01   74.64632596154  0.165594895050  0.080461541929 -0.004718711818 -0.004116313402 -1.020983521e-03  0.0001125557051  7.483685780e-06
[15,]   -0.24120493930 -4.285411042e-02   -0.20946002821 -0.176422335823 -0.014206807669 -0.077412834740 -0.035387063036  3.080360587e-03  0.0147639578887  1.202890691e-01
                 [,11]            [,12]            [,13]            [,14]            [,15]
 [1,] -3.532298841e-02 -2.198746290e-02  1.005024577e-01  3.153743137e-02  3.762607744e-04
 [2,]  8.505404408e-03 -3.645217550e-03  5.406167966e-03 -2.925512608e-03 -4.629549069e-02
 [3,]  1.621603431e-03 -9.569611252e-04  9.013524636e-04 -2.372384292e-05  7.347196690e-05
 [4,]  1.954384249e-03  1.992001858e-05 -3.818481701e-04  5.424005955e-04 -6.305751549e-05
 [5,] -1.114394870e-01  3.063804471e-02 -4.012192529e-02  9.797300731e-03 -4.167515314e-03
 [6,]  1.696482544e-02 -3.978385311e-03  3.607284662e-02 -6.667255515e-02  1.355294167e-03
 [7,]  7.143653351e-05  5.587199188e-06 -5.951218562e-06 -5.318962094e-07  4.039326565e-06
 [8,] -1.493618404e-03  1.351824487e-03  2.950892507e-04  7.015116905e-04  6.939645786e-07
 [9,]  1.404573177e-03 -3.006748588e-03  3.082986432e-03 -1.296965579e-03  3.050614197e-04
[10,] -1.462182502e-04 -3.782986319e-04 -4.115747141e-04 -2.796324769e-05  1.395780333e-04
[11,] -4.539875789e-03  1.496221857e-03 -1.674004444e-02 -3.365876993e-03  4.677206453e-04
[12,]  2.451696986e-02  1.236035119e-01  2.911794945e-02  1.377807824e-03 -2.283957733e-04
[13,] -7.370355444e-06 -6.450554023e-05 -1.489000470e-05  3.528962891e-06  3.579369519e-06
[14,] -1.692131360e-05  9.425228915e-06 -1.559804536e-05 -3.456024328e-06 -9.560906694e-07
[15,]  1.325084196e-01 -2.111337580e-03 -1.791295562e-02  2.501393416e-02 -5.512542075e-04
biplot(wu2.rda, scaling=1)

biplot(wu2.rda, scaling=2)

ordiplot(wu2.rda, choices=c(1,2), type='text')

Do pca on correlation & covariance matrices with princomp

Correlation matrix

wu1.pca <- princomp(~ca+cd+cr+cu+fe+mg+mn+ni+pb+zn+ni+ph+soc+n+p+k, cor=T, data=wu)
summary(wu1.pca)
Importance of components:
                             Comp.1       Comp.2        Comp.3        Comp.4        Comp.5        Comp.6        Comp.7        Comp.8        Comp.9       Comp.10        Comp.11
Standard deviation     2.9272302613 1.5400496837 1.04570938871 0.95162944936 0.70441478608 0.56339607069 0.55034751910 0.49710666852 0.46271997591 0.39706231423 0.331349891270
Proportion of Variance 0.5712451335 0.1581168685 0.07290054171 0.06037324059 0.03308001272 0.02116100883 0.02019215945 0.01647433599 0.01427398507 0.01051056543 0.007319516696
Cumulative Proportion  0.5712451335 0.7293620020 0.80226254376 0.86263578435 0.89571579707 0.91687680590 0.93706896536 0.95354330135 0.96781728642 0.97832785185 0.985647368544
                              Comp.12        Comp.13       Comp.14        Comp.15
Standard deviation     0.274024190279 0.241732174358 0.22294524608 0.179056382494
Proportion of Variance 0.005005950457 0.003895629608 0.00331363885 0.002137412541
Cumulative Proportion  0.990653319001 0.994548948609 0.99786258746 1.000000000000
loadings(wu1.pca)

Loadings:
    Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8 Comp.9 Comp.10 Comp.11 Comp.12 Comp.13 Comp.14 Comp.15
ca   0.270  0.226  0.354         0.121         0.175  0.247  0.204  0.533   0.429   0.200   0.221   0.140   0.136 
cd   0.207 -0.248  0.325        -0.847        -0.143 -0.135                                                       
cr   0.292 -0.111 -0.246  0.181        -0.119 -0.353 -0.452  0.273 -0.151   0.343           0.463          -0.170 
cu   0.320        -0.132                             -0.150  0.166  0.267  -0.671   0.521                   0.128 
fe   0.324        -0.205                                     0.164          0.107  -0.295  -0.273  -0.690   0.391 
mg   0.327                              0.263               -0.136                  0.110  -0.346  -0.170  -0.777 
mn   0.275  0.230               -0.185  0.185  0.653         0.259 -0.514                           0.127         
ni   0.323        -0.146  0.170               -0.199                        0.138          -0.568   0.606   0.286 
pb   0.211 -0.363 -0.293               -0.668  0.347  0.278 -0.195  0.117   0.110                          -0.142 
zn   0.323               -0.158         0.128                       0.224  -0.355  -0.731   0.253   0.249  -0.105 
ph   0.167  0.176  0.616  0.443  0.172 -0.445                      -0.253  -0.210                  -0.110         
soc        -0.558  0.252         0.316  0.211  0.395 -0.513 -0.178  0.111                                         
n          -0.575  0.161         0.156  0.222 -0.174  0.553  0.340 -0.312                                         
p    0.166         0.249 -0.836  0.182 -0.247 -0.171               -0.213   0.128          -0.112                 
k    0.310                              0.222         0.149 -0.746 -0.234           0.153   0.334           0.246 

               Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8 Comp.9 Comp.10 Comp.11 Comp.12 Comp.13 Comp.14 Comp.15
SS loadings     1.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000   1.000   1.000   1.000   1.000   1.000   1.000
Proportion Var  0.067  0.067  0.067  0.067  0.067  0.067  0.067  0.067  0.067   0.067   0.067   0.067   0.067   0.067   0.067
Cumulative Var  0.067  0.133  0.200  0.267  0.333  0.400  0.467  0.533  0.600   0.667   0.733   0.800   0.867   0.933   1.000
autoplot(wu1.pca, data=wu, shape = "landuse", scale=1,
         loadings = TRUE, loadings.colour = 'black',
         loadings.label = TRUE, loadings.label.size = 3, 
         loadings.label.colour="black", loadings.label.hjust=-0.25
         )+
scale_shape_manual(values=c(0,1,2))+
  theme_qk()+
  theme(
    legend.title = element_blank()
  )

PCA on covariance matrix with princomp

wu2.pca <- princomp(~ca+cd+cr+cu+fe+mg+mn+ni+pb+zn+ni+ph+soc+n+p+k, cor=F, data=wu)
summary(wu2.pca)
Importance of components:
                               Comp.1         Comp.2        Comp.3          Comp.4          Comp.5          Comp.6          Comp.7          Comp.8          Comp.9         Comp.10
Standard deviation     274.6972775170 247.4787619002 160.655149471 1.177874635e+01 5.8189681630445 2.337867738e+00 2.021682357e+00 1.492472010e+00 6.837869865e-01 2.092957106e-01
Proportion of Variance   0.4637915538   0.3764349982   0.158636612 8.527314177e-04 0.0002081162956 3.359340305e-05 2.512117605e-05 1.369072715e-05 2.873795017e-06 2.692370233e-07
Cumulative Proportion    0.4637915538   0.8402265521   0.998863164 9.997158954e-01 0.9999240117365 9.999576051e-01 9.999827263e-01 9.999964170e-01 9.999992908e-01 9.999995601e-01
                               Comp.11         Comp.12         Comp.13         Comp.14         Comp.15
Standard deviation     1.791928617e-01 1.291970738e-01 1.202178536e-01 7.851853182e-02 4.643387504e-02
Proportion of Variance 1.973583636e-07 1.025934134e-07 8.882844597e-08 3.789295426e-08 1.325207794e-08
Cumulative Proportion  9.999997574e-01 9.999998600e-01 9.999999489e-01 9.999999867e-01 1.000000000e+00
loadings(wu2.pca)

Loadings:
    Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8 Comp.9 Comp.10 Comp.11 Comp.12 Comp.13 Comp.14 Comp.15
ca                                                           0.131  0.236   0.197   0.170   0.835   0.401         
cd                                                                                                         -0.995 
cr                        0.549 -0.710 -0.428                                                                     
cu                        0.242         0.271 -0.881  0.292                                                       
fe                                                                  0.648   0.621  -0.237  -0.333   0.125         
mg                                                                  0.423                   0.300  -0.848         
mn   0.506  0.152  0.845                                                                                          
ni                        0.345 -0.199  0.839  0.351                                                              
pb                                            -0.276 -0.940  0.174                                                
zn                        0.712  0.670 -0.176                                                                     
ph                                                    0.152  0.970                         -0.139                 
soc                                                                        -0.137  -0.955   0.242                 
n   -0.146 -0.955  0.255                                                                                          
p    0.849 -0.253 -0.464                                                                                          
k                                                                   0.574  -0.738          -0.149   0.318         

               Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8 Comp.9 Comp.10 Comp.11 Comp.12 Comp.13 Comp.14 Comp.15
SS loadings     1.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000   1.000   1.000   1.000   1.000   1.000   1.000
Proportion Var  0.067  0.067  0.067  0.067  0.067  0.067  0.067  0.067  0.067   0.067   0.067   0.067   0.067   0.067   0.067
Cumulative Var  0.067  0.133  0.200  0.267  0.333  0.400  0.467  0.533  0.600   0.667   0.733   0.800   0.867   0.933   1.000
# do biplot
biplot(wu2.pca)

Repeat plot with ggplot2 in progress

get variable loadings as correlations (unscaled variable scores)

scores(wu1.rda, choices=c(1:4), display=‘species’,scaling = 0)

do biplots with scaling=1 (plot distances match euclidean dists - angles between variables irrelevant) and scaling=2

biplot(wu1.rda, scaling=1)

biplot(wu1.rda, scaling=2)

p<-autoplot(wu1.rda, scale=1)
#ordiplot(wu1.rda, choices=c(1,2), display='sites', type='none')
#points (wu1.rda, col = wu$group, pch = wu$group )

try with ordiplot (default scale=2) ordiplot(wu1.rda, choices=c(1,2), display=‘sites’, type=‘none’) points (wu1.rda, col = wu\(group, pch = wu\)group ) do PCA on covariance matrix

options(digits=10) wu2.rda <- rda(wu[,c(‘ph’,‘cond’,‘wdepth’,‘omdepth’,‘cancov’,‘larea’,‘rivernear’,‘wetlandnear’)],scale=FALSE) summary(wu2.rda) scores(wu2.rda, scaling = 0) biplot(wu2.rda, scaling=1) biplot(wu2.rda, scaling=2) ordiplot(wu2.rda, choices=c(1,2), type=‘text’) autoplot(wu2.rda)

do pca on correlation matrix with princomp


f15_3a<-autoplot(wu1.pca, data=wu, shape = "landuse", scale=1,colour=sc,
         loadings = TRUE, loadings.colour = 'black',
         loadings.label = TRUE, loadings.label.size = 3, 
         loadings.label.colour="black", loadings.label.repel=TRUE
         )+
scale_shape_manual(values=c(0,1,2))+
  theme_qk()+
  theme(
    legend.title = element_blank()
  )

Figures

f15_1<-ggplot(wu)+
  geom_point(aes(x=mn,y=cu), alpha=0.5,shape=1)+
  geom_abline(intercept=wu1.rma$regression.results[3,2],
              slope=wu1.rma$regression.results[3,3], colour="black")+
  labs(x="Mn", y="Cu")+
  theme_qk()
f15_1

#Ugly little workaround to get single file with eigenvalues and broken stick into simple file
f1<-as.data.frame(bstick(wu1.rda))
a2<-as.data.frame(wu1.rda$CA$eig)
a2<-cbind(a2,f1)
a2$PC<-row.names(a2)
names(a2)[names(a2) == 'wu1.rda$CA$eig'] <- 'eig'
names(a2)[names(a2) == 'bstick(wu1.rda)'] <- 'bs'
a2$PC <- factor(a2$PC, levels = a2$PC)
a2$ID <- seq_along(a2[,1])
f15_2<-ggplot(a2)+
  geom_bar(aes(x=ID,y=eig),stat="identity", color=lc, fill=lf)+
  scale_y_continuous(expand = c(0,0))+
  geom_line(aes(x=ID,y=bs))+
  geom_point(aes(x=ID,y=bs), shape=1)+
  labs(y="Inertia",x="Principal Component")+
  theme_qk()
f15_2

p1<-autoplot(wu1.pca, data=wu, shape='landuse')
p1<-p1+scale_shape_manual(values=c(0,1,2))+
  theme_qk()+
  theme(
    legend.position = "top",
    legend.title=element_blank()
  )
p2<-autoplot(wu1.pca, shape=FALSE,label=FALSE,
         loadings=TRUE, loadings.label=TRUE, 
         loadings.label.colour="black",
         loadings.colour="black",
         loadings.label.repel=TRUE
)+
  theme_qk()
f15_3<-p1+p2
f15_3

LS0tCnRpdGxlOiAiUSAmIEsgQm94IDE1LjEiCm91dHB1dDoKICB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