component.adj.matrix {sharpshootR} | R Documentation |
Create an adjacency matrix from a data.frame of component data
Description
Create an adjacency matrix from SSURGO component data
Usage
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
)
Arguments
d |
|
mu |
name of the column containing the map unit ID (typically 'mukey') |
co |
name of the column containing the component ID (typically 'compname') |
wt |
name of the column containing the component weight percent (typically 'comppct_r') |
method |
one of either: |
standardization |
community matrix standardization method, passed to |
metric |
community matrix dissimilarity metric, passed to |
rm.orphans |
|
similarity |
logical, return a similarity matrix? (if |
return.comm.matrix |
logical, return pseudo-community matrix? (if |
Value
a similarity matrix / adjacency matrix suitable for use with igraph
functions or anything else that can accommodate a similarity matrix.
Author(s)
D.E. Beaudette
Examples
if (requireNamespace("igraph")) {
# 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')
}