Skip to content

Commit

Permalink
run away braces
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanbeaudette committed Nov 27, 2023
1 parent fa840a8 commit d2dbe6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions R/generalize.hz.R
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,18 @@ setMethod("generalizeHz", signature(x = "SoilProfileCollection"), function(x, ne
})

#' @title Convert cross-tabulation to adjacency matrix.
#' @description Convert a cross-tabulation: {original, genhz} to adjacency matrix.
#' @description Convert a cross-tabulation of e.g. original horizon designations vs. generalized horizon labels to adjacency matrix form.
#'
#' @param tab table, cross-tabulation of original and generalized horizon labels e.g. `table(original, genhz)`
#' @return adjacency matrix
#' @return matrix of numeric values
#' @author D.E. Beaudette
#' @export
genhzTableToAdjMat <- function(tab) {
tab <- as.matrix(tab)
# extract unique set of names
nm <- sort(unique(unlist(dimnames(tab))))
# generate full matrix with named dimensions
m <- matrix(nrow=length(nm), ncol=length(nm), data=0)
m <- matrix(nrow = length(nm), ncol = length(nm), data = 0)
dimnames(m) <- list(nm, nm)
# set adjacency information via sub-matrix containing the original cross-tab
m[rownames(tab), colnames(tab)] <- tab
Expand Down
4 changes: 2 additions & 2 deletions man/genhzTableToAdjMat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d2dbe6b

Please sign in to comment.