This function performs a Pearson pairwise correlation on a given matrix or network data. It includes a switch: whereas for a two-mode network it will perform a regular correlation, including all rows, for an undirected network it will perform a correlation on a matrix with the diagonals removed, for a reciprocated network it will include the difference between reciprocated ties, and for complex networks it will include also the difference between the self ties in each pairwise calculation. This function runs in \(O(mn^2)\) complexity.

to_correlation(.data, method = NULL)

Arguments

.data

An object of a manynet-consistent class:

  • matrix (adjacency or incidence) from {base} R

  • edgelist, a data frame from {base} R or tibble from {tibble}

  • igraph, from the {igraph} package

  • network, from the {network} package

  • tbl_graph, from the {tidygraph} package

method

One of the following: "all" includes all information, "diag" excludes the diagonal (self-ties), "recip" excludes the diagonal but compares pairs' reciprocal ties, and "complex" compares pairs' reciprocal ties and their self ties. By default the appropriate method is chosen based on the network format.