-1
I would like to create an index by searching only part of the text.
x <- c(4, 1, 6, "ab", 2, 1, "aa")
which(x == "a")
In the vector above, for example, I would like the return to be
[1] 4 7
That is, return all lines that contain the letter "a", regardless of whether you have anything else, line or letters.
Welcome to Stackoverflow! Try grep("a", x) and grepl("a", x)
– Daniel Ikenaga