a <- c("hoge","fuga","piyo")b <- c("hage","fuga","peyo","hoge") aa[2]a[c(T,T,F)]a %in% ba[a %in% b]
Standard input is empty
[1] "hoge" "fuga" "piyo" [1] "fuga" [1] "hoge" "fuga" [1] TRUE TRUE FALSE [1] "hoge" "fuga"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!