Suppose I do something like the following:
x <- 'zeal'
t <- strsplit(x, '')
g <- unlist(t)
g
[1]"z" "e" "a" "l"
r <- letters[(which(g[1] == letters))]
r
[1]"z"
My end goal for this is to have something where I can say "find the element in some variable
which matches something
so for example, if I had
e <- 'bacon'
e <- strsplit(e, '')
e <- unlist(e)
e
[1]"b" "a" "c" "o" "n"
then "find the element in e
which matches "b"". And then apply that over until all elements in e
are matched