list2concordance | R Documentation |
Convert list to concordance matrix
list2concordance(x, naValue = NA, makeSigned = TRUE, verbose = FALSE, ...)
x |
|
naValue |
value passed to |
makeSigned |
logical indicating whether to force the vectors in
the input list |
verbose |
logical indicating whether to print verbose output. |
... |
additional arguments are passed to |
This function calculates pairwise concordance using Kruskal concordance coefficient (ref) using the following equation:
(number_agree - number_disagree) / (total_shared)
The equation is applied to each pair of named vectors in the input
list x
, and reflects the degree of agreement in direction (+ or -)
between shared named elements, with +1 being perfect concordance
(agreement), and -1 being perfect discordance (disagreement.) Values
of zero indicate equal agreement and disagreement, and therefore
reflect no concordance nor discordance. Values
of NA
occur when no named entries are shared.
This function calls list2imSigned()
to produce a signed
incidence matrix, which is then used with base::crossprod()
to calculate the full matrix of values.
Other jam list functions:
colors_from_list()
,
im2list_dep()
,
im2list()
,
imSigned2list_dep()
,
imSigned2list()
,
list2imSigned()
,
list2im()
set.seed(123);
l123 <- lapply(jamba::nameVector(1:3), function(i){
jamba::nameVector(
sample(c(-1,-1,0,1), replace=TRUE, size=15),
letters[1:15]
)
});
list2concordance(l123);
# observe the signed incidence matrix
list2imSigned(l123);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.