I am trying to automate a report that I am running manually each week. I have a data frame called p_wide where each week a new column is being added and column names contain dates that represent when each of those columns are added, for example:
id col_2022_09_04 col_2022_09_11 col_2022_09_18 col_2022_09_25
--- -------------- -------------- -------------- --------------
01 0.3 0.8 0.9 0.1
02 0.6 0.1 0.4 0.5
03 0.2 0.1 0.3 0.4
04 0.1 0.7 0.4 0.9
In my report, I create a subset of p_wide dataframe using a filter. For example:
p_mover <- p_wide %>% filter(abs(col_2022_09_18 - col_2022_09_25) > .33)
Is there a way that I can specify those two columns above without manually typing each week?