Let's say I have a tibble named sample_tbl
with thousands of columns. What I want to do is this:
sample_tbl %<>% .[, str_detect(colnames(.), "some_pattern_here")]
But in my opinion using [
and ]
for selecting columns makes codes less readable. Is there any alternative way to do this specific job? As far as I know select
does not support pattern matching for column names.