get_common_names {usefun} | R Documentation |
Get the common names of two vectors
Description
This function prints and returns the common names
of two vectors. The
two vectors don't have to be the same length.
Usage
get_common_names(vec1, vec2, vector.names.str = "nodes", with.gt = TRUE)
Arguments
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. |
Value
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.
See Also
pretty_print_vector_values
, pretty_print_string
Examples
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)
[Package usefun version 0.5.0 Index]