Dave Robinson · GitHub

Two main questions:

  • why the name, and is there an alternative: I'm working off the possible precedent of add_predictions, add_predictors, and add_residuals from the modelr package. These are functions that take a table and add specifically calculated columns, like the above.

    The alternative we've used in the tidytext package is bind_tf_idf, when we add three columns (tf, idf, and tf_idf) to a table without otherwise changing it. If there's another prefix that means "add a column" I'm open to it, though I don't think mutate_ or append_ would be right.

    We could try to come up with clever verbs that don't refer to count or tally specifically (like... enumerate and tick or something) but I think that's making it more obscure

  • why the grouping behavior: I think it is important to return the tbl to its original grouping, because most of the time when this verb is useful, it is immediately followed by filtering or mutating, which are faster when ungrouped. (filtering is a particularly common pitfall). I also think that if the grouping behavior were preserved, one might as well just have used group_by so that it's clearer

Read the original on github.com ↗