Hydrologic Ordering of a Geomorphic Proportion Matrix

hydOrder(x, g, clust = TRUE, j.amount = 0)

Arguments

x

x data.frame, geomorphic proportion matrix, as created by soilDB::fetchOSD(..., extended=TRUE)

g

character, name of geomorphic summary table, one of: c('geomcomp', 'hillpos', 'flats', 'terrace', 'mtnpos', 'shape')

clust

logical, perform clustering of geomorphic proportion matrix

j.amount

amount of noise applied to rows having a duplicate proportion vector, passed to jitter()

Value

when clust = FALSE a vector of series names, in hydrologic ordering, otherwise a list with the following elements:

  • clust: rotated hclust object

  • hyd.order: vector of series names, in hydrologic ordering

  • clust.hyd.order: vector of series names, after clustering + rotation, approximate hydrologic ordering

  • match.rate: fraction of series matching target hydrologic ordering, after clustering + rotation

  • obj: objective function value (sum of squared rank differences), used by iterateHydOrder()

Author

D.E. Beaudette

Examples


# example data, similar to results from soilDB::fetchOSD(..., extended = TRUE)
data("OSDexamples")

# no clustering of the geomorphic proportion matrix
h <- hydOrder(OSDexamples$hillpos, g = 'hillpos', clust = FALSE)

# compare with original order

data.frame(
original = OSDexamples$hillpos$series,
ordered = h
)
#>    original  ordered
#> 1    AMADOR   PARDEE
#> 2  ARGONAUT    CECIL
#> 3     CECIL  REDDING
#> 4   DRUMMER    PENTZ
#> 5   HANFORD   MOGLIA
#> 6    MOGLIA   AMADOR
#> 7    MUSICK   MUSICK
#> 8     PALAU   SIERRA
#> 9    PARDEE ARGONAUT
#> 10    PENTZ    PALAU
#> 11  REDDING    VLECK
#> 12   SIERRA  HANFORD
#> 13 SYCAMORE     YOLO
#> 14    VLECK  DRUMMER
#> 15  WILLOWS     ZOOK
#> 16     YOLO SYCAMORE
#> 17     ZOOK  WILLOWS

# cluster results
h <- hydOrder(OSDexamples$hillpos, g = 'hillpos', clust = TRUE)
#> Registered S3 method overwritten by 'dendextend':
#>   method     from 
#>   rev.hclust vegan
str(h)
#> List of 5
#>  $ clust          :List of 7
#>   ..$ merge      : int [1:16, 1:2] -4 1 -10 2 -5 -7 -3 -9 3 7 ...
#>   ..$ height     : num [1:16] 0.00285 0.02475 0.05167 0.05223 0.10365 ...
#>   ..$ order      : int [1:17] 9 11 3 6 8 10 1 7 12 2 ...
#>   ..$ labels     : chr [1:17] "AMADOR" "ARGONAUT" "CECIL" "DRUMMER" ...
#>   ..$ call       : language diana(x = daisy(x.prop, type = list(numeric = 1:n.prop)))
#>   ..$ method     : logi NA
#>   ..$ dist.method: chr "euclidean"
#>   ..- attr(*, "class")= chr "hclust"
#>  $ hyd.order      : chr [1:17] "PARDEE" "CECIL" "REDDING" "PENTZ" ...
#>  $ clust.hyd.order: chr [1:17] "PARDEE" "REDDING" "CECIL" "MOGLIA" ...
#>  $ match.rate     : num 0.0588
#>  $ obj            : num 962