function for finding non-identical elements in two vectors

r, vector

Solution

This popped up on Tony Breyal's blog a few years ago, you can see several solutions there, here's the shortest one:

c(setdiff(x,y),setdiff(y,x))

Problem

Simple question, but didn't find it on stackoverflow. Is there a function for finding all non-identical values: ``` x <- c("a","b","c","d") y <- c("a","f","g","c","d") ``` result should be: ``` res <- c("b","f","g") ``` All functions seem to only work for one vector. `setdiff()` etc.

Original source