I have a data frame ("data") with lots and lots of columns. Some of the columns contain a certain string ("search_string").
How can I use dplyr::select() to give me a subset including only the columns that contain the string?
# columns as boolean vector
# columns as vector of column names names
Neither of them works.
I know that select() accepts numeric vectors as a substitute for columns e.g.:
But I don't know how to get a numeric vector of columns IDs from my grepl() expression.