There are many columns that need to be included, so it would be better to not have to write them out.
There are two problems with this code
invoke is deprecated, and
It looks unnecessarily (maybe?) complicated
The change suggested by the help file returns an error ie just placing "!!!" in front of across.
# Before:
invoke(mean, list(na.rm = TRUE), x = 1:10)
# After
exec(mean, 1:10, !!!list(na.rm = TRUE))
Anyway, I can't remember why I wrote the code the way that I did, it seems unnecessarily complex. Am I missing some obvious way to compute a function mapping a subset of columns to one column?
which labels the new columns by their column name followed by the function used, but the benefit you have is that you have conventional columns in your results frame, rather than a column being a matrix etc.