get_common_values | R Documentation |
This function prints and returns the common values of two vectors. The two vectors don't have to be the same length.
get_common_values(vec1, vec2, vector.values.str = "nodes", with.gt = TRUE)
vec1 |
vector |
vec2 |
vector |
vector.values.str |
string. Used for printing, it tell us what are the values of the two vectors (use plural form). Default value: "nodes". |
with.gt |
logical. Determines if the ">" sign will be appended for nice printing in an R notebook (use with the chuck option results = 'asis'). Default value: TRUE. |
the vector of the common values. If there is only one value
in common, the vector.values.str
gets the last character stripped for
readability. If there are no common values, it returns NULL.
pretty_print_vector_values
, pretty_print_string
vec1 = c(1,2,3)
vec2 = c(3,4,1)
common.names = get_common_values(vec1, vec2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.