I have a dataframe where most of the column names are as below:
tre_ui_1920
tre_ui_2221
tre_ui_8989
and something like
foo_bar_123
foo_bar_456
I want to delete all the columns belonging to foo_bar_*
and tre_ui_*
I have seen few codes in R which suggest to use subset and indexing. Is there any better way to do this?