powered by
Function to get cols for the pattern given
get_col_multiple_pattern(pattern, the_data)
zero or -1
the pattern to look for
data where to look at
the_data <- as.data.frame(cbind(c("one", "two"), c("a", "b"), c("aa", "bb"))) colnames(the_data) <- c("name", "brand_one", "two") get_col_multiple_pattern(c("brand", "trade"), the_data)
Run the code above in your browser using DataLab