# Values that are members of set
A <- c(5, 3, 4, 2)
B <- c(2, 4, 4, 4, 6, 8)
ismember(A, B)
# Members of set and indices to values
ismember(A, B, indices = TRUE)
# Table rows found in another table
A <- data.frame(
"V1" = 1:5, "V2" = LETTERS[1:5], "V3" = as.logical(c(0, 1, 0, 1, 0))
)
B <- data.frame(
"V1" = seq(1, 9, 2), "V2" = LETTERS[seq(1, 9, 2)], "V3" = as.logical(rep(0, 5))
)
ismember(A, B)
Run the code above in your browser using DataLab