i want to select columns from a data frame by name. the names of the columns are in a separate list, but the names in the list and the names of the columns are not exactly the same.
so here's my code:
list.of.names <- c('Var_1', 'Var_2')
But the column names are like this 'Var.1', Var.2'
I tried it with this:
new.df <- old.df %>% select(c(list.of.names))
Is there any function that does not distinguish between '.' and '_'?
Thanks for the help!