Learn R Programming

qwraps2 (version 0.5.2)

set_diff: Set Differences

Description

function for testing for unique values between two vectors, specifically, which values are in vector1, and not in vector2, which values are not in vector1 and in vector2, which values are in both vector1 and vector2.

Usage

set_diff(x, y)

Arguments

x, y

vectors (of the same mode)

Details

Wrapper to call the union,

Examples

Run this code
# NOT RUN {
# example with two sets which as a union are the upper and lower case vowels.
set_a <- c("A", "a", "E",      "I", "i", "O", "o", "U", "u", "E", "I")
set_b <- c("A", "a", "E", "e",      "i",      "o", "U", "u", "u", "a", "e")
set_diff(set_a, set_b)
set_diff(set_b, set_a)

# example
set_a <- 1:90
set_b <- set_a[-c(23, 48)]
set_diff(set_a, set_b)
set_diff(set_b, set_a)

# example
set_a <- c("A", "A", "B")
set_b <- c("B", "A")
set_diff(set_a, set_b)

# }

Run the code above in your browser using DataLab