I have this dataframe:
state county city region mmatrix X1 X2 X3 A1 A2 A3 B1 B2 B3 C1 C2 C3 1 1 1
I found a simple answer using dplyr/tidyverse. If your colnames contain "This", then all variables containing "This" will be dropped.
library(tidyverse) df_new <- df %>% select(-contains("This"))