My best guess here is I think the enquos is maybe capturing the list command? But I can't unlist bares I don't think... Any help on how to use enquos() on a list of bares in a function would be great!
Follow-up question @aosmith : Would this approach, i.e., using vars(), be the "correct" tidyeval way to pass any number of grouping variables (including none) into a function without using the dots argument for the bare column names? For example, should I be writing my functions as follows when I want to allow the user to choose any number of grouping columns, including none:
The way I understand tradeoff between dots and vars is that often times you'll need two sets of dots. For example, when using mutate_at, dots are already "taken" by the function you are passing in and its arguments. Therefore, if you still want to be flexible in passing in any number of variables in, you have to use something like vars.
For that reason, if you don't have dots that are already taken by something else, it's always a good idea to just pass dots in since then you don't need to do anything, but pass dots further into group_by/mutate or whatever. This will change what you can pass into the function, of course. You'll no longer be able to use selection (i.e., c, starts_with etc.), but from a user's perspective you can always make sure to mention whether this function is based around actions or selections (https://resources.rstudio.com/rstudio-conf-2019/working-with-names-and-expressions-in-your-tidy-eval-code).
Well, I'm not an expert but I think this is a correct way to pass things if you don't want to use dots. I saw a comment on this SO answer from Lionel Henry that I read to mean using dplyr::vars() like this is appropriate (but could have misinterpreted).
I've also used alist() instead of list() for these kinds of tasks (also mentioned in that comment), but it didn't seem to work quite right in this scenario.