I use this code to list the name of some variables in my R environment.
> IDs <- grep("_temp", ls(), value = T, invert = T)
> str(IDs)
char [1:2] "X" "Y"
Next, I tried to use this IDs to find the colnames with map
IDs %>%
map(~ colnames(.x))
However, this does not work because both X and Y are inside the "" -> "X" and "Y". Which makes the command be like this:
colnames("X")
What do I need to do to make the command to run like this:
colnames(X)