Description Usage Arguments Value Examples
commonValVec takes as input two vectors (vec1
and vec2
) and returns a vector containing the common values present in both vectors.
1 | commonValVec(vec1, vec2)
|
vec1 |
a vector to be compared |
vec2 |
a vector to be compared |
commonValVec returns a vector containing the common values present in both vectors. If the common values are all numeric then the output vector is of class numeric. If at least one of the common values is a character, then the output vector is of class character.
1 2 3 | commonValVec(c(1,2,"a"),c(2,"a",3,4,5))
commonValVec(c(1,2,"dog",10,"apple"),c(11,22,"dog",2,"orange"))
commonValVec(c(1,2,4,8),c(8,22,2,"dog"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.