I have two vectors in R as shown below. The first one represents amino acid numbers with some positions missing while the second one represents the full list. I need to some
to return the indices use %in%
> (a <- letters[1:5]) [1] "a" "b" "c" "d" "e" > b <- c("a", "b", "e", "f") > (which(a%in%b)) [1] 1 2 5 > (which(b%in%a)) [1] 1 2 3