extractInfo | R Documentation |
Extracts useful information such as the counts or the actual intersections between several sets.
extractInfo(
x, what = c("counts", "intersections", "both"), use.names = FALSE
)
x |
A list object containing set elements, or a list of binary values |
what |
What to extract |
use.names |
Logical, use the set names to indicate intersections |
When the argument x
is a list, the counts are taken from the number
of common values for each intersection, and when x
is a dataframe,
(comprised of exclusively binary values 0 and 1) the counts are taken from the
number of similar rows.
A dataframe, when extracting the counts or a list if extracting intersections.
set.seed(12345)
xlist <- list(A = 1:20, B = 10:30, C = sample(25:50, 15))
xdf <- as.data.frame(matrix(
sample(0:1, 90, replace = TRUE),
ncol = 3
))
colnames(xdf) <- LETTERS[1:3]
extractInfo(xlist) # counts by default
extractInfo(xlist, what = "intersections")
extractInfo(xlist, what = "both")
extractInfo(xdf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.