Description Usage Arguments Value Examples
Straightforwardly extract particular elements from the output of compare.vectors
.
1 2 3 | extract.compared.vectors(output_from_compare.vectors, vector_names = NULL,
only_match_vector_names = FALSE, degrees_of_comparison = NULL,
elements_of_output = NULL)
|
output_from_compare.vectors |
The list output of |
vector_names |
An optional vector of names to extract from the named list ( |
only_match_vector_names |
A logical (TRUE/FALSE) indicator whether to match only |
degrees_of_comparison |
An optional number of vector of numbers indicating which degrees of comparison to return (for example, 2 will return only two-way comparisons from |
elements_of_output |
An optional vector of element names from |
A winnowed version of output_from_compare.vectors
. Depending on arguments, either a list, a vector, or a string.
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 27 28 29 30 31 32 33 34 35 | 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
)
# A more complex / specific example:
extract.compared.vectors(
example,
vector_names = c("vector_a", "vector_c"),
only_match_vector_names = FALSE,
degrees_of_comparison = c(2, 3),
elements_of_output = "elements_involved"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.