Description Usage Arguments Value Examples
Compare all combinations of vectors using set operations
1 2 3 4 5 6 7 8 | compare.vectors(named_list_of_vectors_to_compare,
degrees_of_comparison_to_include = NULL, draw_venn_diagrams = FALSE,
vector_colors_for_venn_diagrams = NULL, save_venn_diagram_files = FALSE,
location_for_venn_diagram_files = "", prefix_for_venn_diagram_files = "",
saved_venn_diagram_resolution_ppi = 300,
saved_venn_diagram_dimension_units = "in", saved_venn_diagram_width = 8,
saved_venn_diagram_height = 6, viewport_npc_width_height_for_images = 1,
suppress_messages = FALSE)
|
named_list_of_vectors_to_compare |
A named list of vectors to compare (see, for example, |
degrees_of_comparison_to_include |
A number or vector of numbers of which degrees of comparison to print (for example, 'c(2, 5)' would print only 2- and 5-way vector comparisons). |
draw_venn_diagrams |
A logical (TRUE/FALSE) indicator whether to draw Venn diagrams for all 2- through 5-way comparisons of vectors. |
vector_colors_for_venn_diagrams |
An optional vector of color names for Venn diagrams (if |
save_venn_diagram_files |
A logical (TRUE/FALSE) indicator whether to save Venn diagrams as PNG files. |
location_for_venn_diagram_files |
An optional string giving a directory into which to save Venn diagram PNG files (if |
prefix_for_venn_diagram_files |
An optional string giving a prefix to prepend to saved Venn diagram PNG files (if |
saved_venn_diagram_resolution_ppi |
An optional number giving a resolution (PPI) for saved Venn diagrams (if |
saved_venn_diagram_dimension_units |
An optional string giving units for specifying |
saved_venn_diagram_width |
The width (in |
saved_venn_diagram_height |
The height (in |
viewport_npc_width_height_for_images |
The scale at which to print an image. If the image is cut off at its edges, for example, this can be set lower than 1.0. |
suppress_messages |
A logical (TRUE/FALSE) indicator whether to suppress messages. Even if this is |
A list, with one object for each comparison of vectors. The list contains the following elements:
The vector names involved in the comparison.
A vector of all (deduplicated) items involved in the comparison, across all of the vectors.
A vector of the deduplicated elements that occurred in all of the compared vectors.
This element will have a sub-element named for each vector being compared (i.e., for each of the names in $elements_involved
). The (deduplicated) items that were unique to that vector (i.e., not overlapping with any other vector in the comparison).
If save_venn_diagram_files
is TRUE
, and the comparison is of 2 through 5 vectors, a Venn diagram object produced using the VennDiagram package. This diagram can be rendered using render.venn.diagram
.
To compile this list object into a Markdown report, use compare.vectors.and.return.text.analysis.of.overlap
. For an example of this usage, see the Veccompare Overlap Report
RMarkdown template for RStudio that is installed as part of the veccompare package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | example <- veccompare::compare.vectors(veccompare::example.vectors.list)
# To extract similar elements across list items:
veccompare::extract.compared.vectors(
example,
elements_of_output = "elements_involved"
)
# To extract all comparisons that involve "vector_a":
veccompare::extract.compared.vectors(
example,
vector_names = "vector_a"
)
# To find all comparisons that were about "vector_a" and "vector_c":
veccompare::extract.compared.vectors(
example,
vector_names = c("vector_a", "vector_c"),
only_match_vector_names = TRUE
)
# To get all elements that did a two-way comparison:
veccompare::extract.compared.vectors(
example,
degrees_of_comparison = 2
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.