I have a dataframe where the columns are alphabetically ordered (COL_A, COL_B, COL_C, etc.). How can I subset out columns H to M, without writing out the column names explicitly, or without counting how many columns there are?
Edit for clarification: I don't mean to say that the columns are exactly COL_A, COL_B and so on, merely that they are alphabetically arranged with any common structure in the name-strings. They can be, for example, Alabama, Arkansas, Texas, Wyoming, and Zambia. In an nutshell, I am trying to find an alternative to df_subset = df[,n1:n2]
where I can directly put in the column names instead of having to count out the column numbers n1 and n2.