I have two character vectors, x and y.
x <- c(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\") y <- c(\"a\", \"c\", \"d\", \"e\", \"g\") <
x <- c(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\") y <- c(\"a\", \"c\", \"d\", \"e\", \"g\")
> x[!x %in% y] [1] "b" "f"
or:
> x[-match(y,x)] [1] "b" "f" >