prune_and_reorder_vector | R Documentation |
Given two vectors, the first one's elements are pruned and reordered according
to the common values of the second vector and the elements' names
(attribute) of the first. If there no common such values, an empty vector is
returned.
prune_and_reorder_vector(vec, filter.vec)
vec |
a vector with |
filter.vec |
a character vector whose values will be used to filter the
|
the pruned and re-arranged vector.
vec = c(1,2,3)
names(vec) = c("a","b","c")
filter.vec1 = c("a")
prune_and_reorder_vector(vec, filter.vec1)
filter.vec2 = c("c", "ert", "b")
prune_and_reorder_vector(vec, filter.vec2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.