Can I search a character list for a string where I don\'t know how the string is cased? Or more generally, I\'m trying to reference a column in a dataframe, but I don\'t kn
Another way of achieving this is to use str_which(string, pattern) from the stringr package:
str_which(string, pattern)
stringr
library("stringr") str_which(string = tolower(colnames(iris)), pattern = "species")