col_subset() is a wrapper around m[, str_detect(colnames(m), pattern)]
col_subset(m, pattern, negate = FALSE)
Input matrix or data frame.
Pattern to look for. The default interpretation is a regular expression, as described in stringi::stringi-search-regex. Control options with 'regex()'.
If 'TRUE', return non-matching columns.
A matrix.
Vectorised over colnames('m') and 'pattern'