plot_similarity function

Plot similarity objective by cluster

Plot similarity objective by cluster

plot_similarity(x, groups)

Arguments

  • x: The data input. Can be one of two structures: (1) A data matrix where rows correspond to elements and columns correspond to features (a single numeric feature can be passed as a vector). (2) An N x N matrix dissimilarity matrix; can be an object of class dist (e.g., returned by dist or as.dist) or a matrix where the entries of the upper and lower triangular matrix represent the pairwise dissimilarities.
  • groups: A grouping vector of length N, usually the output of matching.

Returns

The diversity (sum of distances) by group.

Details

Plots the sum of pairwise distances by group.

Examples

# Match elements and plot similarity by match N <- 100 lds <- data.frame(f1 = rnorm(N), f2 = rnorm(N)) pairs <- matching(lds, p = 2) plot_similarity(lds, pairs)

See Also

diversity_objective

Author(s)

Martin Papenberg martin.papenberg@hhu.de

  • Maintainer: Martin Papenberg
  • License: MIT + file LICENSE
  • Last published: 2024-10-01