How could I refer to a variable new in a function without writing them as string or indexing before. I want to construct a function where I can replace grouping variables easily.
For example:
final_table %>% data.table::dcast(Lipids ~ combi_new)
Another time this factor variable could be named differently.
e.g., group_2
It doesn't work with final_table[,2]
- how could I solve this?
Thanks, Nadine