commonValVec: commonValVec

Description Usage Arguments Value Examples

View source: R/commonValVec.R

Description

commonValVec takes as input two vectors (vec1 and vec2) and returns a vector containing the common values present in both vectors.

Usage

1
commonValVec(vec1, vec2)

Arguments

vec1

a vector to be compared

vec2

a vector to be compared

Value

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.

Examples

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"))

lwTools/agriTrf documentation built on March 26, 2020, 12:09 a.m.