I'm trying to eval(parse()) variable names from a character vector, but eval() returns only the content of the last variable:
My code:
c <- c(1,1) a <- c(1,0) t <- c(0,1) g <- c(0,0) sequence <- c("a", "t", "g", "t", "g", "t", "a", "c") eval(parse(text=sequence)) It should return:
[1] 1 0 0 1 0 0 0 1 0 0 0 1 1 0 1 1
But it just returns the correspondent to the last element of the vector: c
[1] 1 1