I have a situation where I need to process different files. There is an "ID" field in all the files, but sometimes it is named differently depending on the file. For example, it can be called "ID1" or "ID_1", etc.
I want the user to be able to specify the name of the "ID" column and then use that in my R script.
Here is what I have so far, which doesn't work.
id_col <- "ID_1" bad_length <- file %>% filter(str_length(.$id_col) != 10)
How do I reference
str_length()? I tried using
.$(!!id_col) as the argument to
str_length() but that didn't work.