get_common_names | R Documentation |
This function prints and returns the common names
of two vectors. The
two vectors don't have to be the same length.
get_common_names(vec1, vec2, vector.names.str = "nodes", with.gt = TRUE)
vec1 |
vector with |
vec2 |
vector with |
vector.names.str |
string. Used for printing, it tell us what are the
|
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 character vector of the common names. If there is only one name
in common, the vector.names.str
gets the last character stripped for
readability. If there is no common names, it returns FALSE.
pretty_print_vector_values
, pretty_print_string
vec1 = c(1,1,1)
vec2 = c(1,2)
names(vec1) = c("a","b","c")
names(vec2) = c("c","b")
common.names = get_common_names(vec1, vec2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.