R/component.adj.matrix.R
component.adj.matrix.Rd
Create an adjacency matrix from SSURGO component data
component.adj.matrix(
d,
mu = "mukey",
co = "compname",
wt = "comppct_r",
method = c("community.matrix", "occurrence"),
standardization = "max",
metric = "jaccard",
rm.orphans = TRUE,
similarity = TRUE,
return.comm.matrix = FALSE
)
data.frame
, typically of SSURGO data
name of the column containing the map unit ID (typically 'mukey')
name of the column containing the component ID (typically 'compname')
name of the column containing the component weight percent (typically 'comppct_r')
one of either: community.matrix
, or occurrence
; see details
community matrix standardization method, passed to vegan::decostand
community matrix dissimilarity metric, passed to vegan::vegdist
logical
, should map units with a single component be omitted? (typically yes)
logical, return a similarity matrix? (if FALSE
, a distance matrix is returned)
logical, return pseudo-community matrix? (if TRUE
no adjacency matrix is created)
a similarity matrix / adjacency matrix suitable for use with igraph
functions or anything else that can accommodate a similarity matrix.
if (requireNamespace("igraph") && requireNamespace("vegan")) {
# load sample data set
data(amador)
# convert into adjacency matrix
m <- component.adj.matrix(amador)
# plot network diagram, with Amador soil highlighted
plotSoilRelationGraph(m, s = 'amador')
}
#> Loading required namespace: igraph
#> Loading required namespace: vegan