cluster_corr_mat: Cluster a matrix of correlated features

View source: R/corr_feats.R

cluster_corr_matR Documentation

Cluster a matrix of correlated features

Description

Cluster a matrix of correlated features

Usage

cluster_corr_mat(bin_corr_mat, hclust_method = "single", cut_height = 0)

Arguments

bin_corr_mat

a binary correlation matrix created by get_binary_corr_mat().

hclust_method

the method to use in stats::hclust() (default: 'single').

cut_height

the cut height (h) to use in stats::cutree() (default: 0).

Value

a named vector from stats::cutree(). Each element is a cluster and the name is a feature in that cluster.

Author(s)

Kelly Sovacool, sovacool@umich.edu

Pat Schloss, pschloss@umich.edu

Examples

## Not run: 
corr_mat <- matrix(
  data = c(1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1),
  nrow = 4,
  dimnames = list(
    c("a", "b", "c", "d"),
    c("a", "b", "c", "d")
  )
)
corr_mat
cluster_corr_mat(corr_mat)

## End(Not run)

mikropml documentation built on Aug. 21, 2023, 5:10 p.m.