4.1 Ordination procedure

Depending on which type of distance calculation (RRD/NI), protocol 2 performs different ordination methods (PCoA/NMDS). Both PCoA and NMDS require specifying the number of dimensions in which to project the data. Therefore, you must generate specific 2D and 3D ordination objects:

prot2a_2d <- apply_ordination(cleanAmphorae[!isShipwreck,],
                              "2a", # select protocol 2a (RRD & PCoA)
                              exception_columns = excep_cols,
                              variable_tags = varCode)

prot2b_2d <- apply_ordination(cleanAmphorae[!isShipwreck,],
                              "2b", # select protocol 2a (NI & NMDS)
                              exception_columns = excep_cols,
                              variable_tags = varCode)

prot2a_3d <- apply_ordination(cleanAmphorae[!isShipwreck,],
                              "2a", # select protocol 2a (RRD & PCoA)
                              exception_columns = excep_cols,
                              variable_tags = varCode,
                              dimensions = 3)

prot2b_3d <- apply_ordination(cleanAmphorae[!isShipwreck,],
                              "2b", # select protocol 2a (NI & NMDS)
                              exception_columns = excep_cols,
                              variable_tags = varCode,
                              dimensions = 3)

The ordination objects generated with protocol 2 are different from those in protocol 1 since it uses different functions. However, the main components are still the same: the projection of observations or scores (points) and of variables or loadings.

class(prot2a_2d)
#> [1] "list"
names(prot2a_2d)
#>  [1] "points"        "eig"           "x"             "ac"           
#>  [5] "GOF"           "sub2D"         "GOF2_2D"       "loadings"     
#>  [9] "variable_tags" "name"          "dist_matrix"
class(prot2b_2d)
#> [1] "metaMDS" "monoMDS"
names(prot2b_2d)
#>  [1] "nobj"          "nfix"          "ndim"          "ndis"         
#>  [5] "ngrp"          "diss"          "iidx"          "jidx"         
#>  [9] "xinit"         "istart"        "isform"        "ities"        
#> [13] "iregn"         "iscal"         "maxits"        "sratmx"       
#> [17] "strmin"        "sfgrmn"        "dist"          "dhat"         
#> [21] "points"        "stress"        "grstress"      "iters"        
#> [25] "icause"        "call"          "model"         "distmethod"   
#> [29] "distcall"      "distance"      "converged"     "tries"        
#> [33] "engine"        "species"       "data"          "init_seed"    
#> [37] "trymax"        "sub_stress"    "sub2D"         "GOF2_2D"      
#> [41] "loadings"      "variable_tags" "name"          "dist_matrix"