pca_central_element: Determine the most central of a list of elements based on pca...

pca_central_elementR Documentation

Determine the most central of a list of elements based on pca scores

Description

Calculates maximum total euclidean distance from each element to all other elements through as many principle components as necessary based on the method indicated.

Usage

pca_central_element(
  pca_data,
  elements,
  max_depth = ncol(pca_data) - 1,
  centrality_method = "max-depth"
)

Arguments

pca_data

Data.frame or matrix of pca loadings ( elements x principle components )

elements

Character vector of the set of elements from which to determine centrality. Values must be a subset of pca_data rownames.

max_depth

An integer indicating the maximum number of Principle Components to use in determining most central element

centrality_method

A one-length character vector with value "two-in-a-row", "max-depth" or "first-most-frequent". "two-in-a-row" selects whichever feature shows up two times in a row as you compare more and more pc's. So if you get feature a when including only pc1-pc2 , feature b for pc1-pc3, and feature b for pc1-pc4, it would return feature b. "first-most-frequent" returns whichever feature shows up the most times as you compare each number of PC's. "First" because if different features each show up the same number of times whichever showed up with the fewest pc's is returned.

Value

Returns the element name that is most central based on minimum euclidean distance through n principle components.


Benjamin-Vincent-Lab/binfotron documentation built on Oct. 1, 2024, 8:33 p.m.