Converts a co-occurrence matrix (coma) to a co-occurrence vector (cove)
get_cove(x, ordered = TRUE, normalization = "none")
x | A matrix - an output of the |
---|---|
ordered | The type of pairs considered. Either "ordered" (TRUE) or "unordered" (FALSE). The default is TRUE. |
normalization | Should the output vector be normalized? Either "none" or "pdf". The "pdf" option normalizes a vector to sum to one. The default is "none". |
A co-occurrence vector
#> 1 2 3 #> 1 4 1 3 #> 2 1 2 2 #> 3 3 2 6cov = get_cove(com) cov#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] #> [1,] 4 1 3 1 2 2 3 2 6cov = get_cove(com, normalization = "pdf") cov#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] #> [1,] 0.1666667 0.04166667 0.125 0.04166667 0.08333333 0.08333333 0.125 #> [,8] [,9] #> [1,] 0.08333333 0.25