Learn R Programming

ribiosUtils (version 1.5-6)

compTwoVecs: Compare two vectors by set operations

Description

Basic set operations are used to compare two vectors

Usage

compTwoVecs(vec1, vec2)

Arguments

vec1

A vector of atomic types, e.g. integers, characters, etc.

vec2

A vector of the same type as vec1

Value

A vector of six integer elements

vec1.setdiff

Number of unique items only in vec1 but not in vec2

intersect

Number of items in both vec1 and vec2

vec2.setdiff

Number of unique items only in vec2 but not in vec1

vec1.ulen

Number of unique items in vec1

vec2.ulen

Number of unique items in vec2

union

Number of unique items in vec1 and vec2

Examples

Run this code
# NOT RUN {
year1 <- c("HSV", "FCB", "BVB", "S04", "FCN")
year2 <- c("HSV", "FCK", "S04")
compTwoVecs(year1, year2)

# }

Run the code above in your browser using DataLab