You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of supplying a single function that must work for all columns or all numeric columns, make it so one supplies either a function or a list of functions. If a function, it will be used on all columns. If a list of functions, it will use any function that matches the column name. If there is none, it will default to one for that type. This is a clever approach to handling mixed data data frames.
The default func should be something like:
list(.numeric = wtd_sum, .default = first_row)
So, given a column, it is tested for numerical status (integer or double). If yes, then the values are summed. If not, it defaults to .default and takes the first row. In this way, every column is processed. One can make it possible for there to be no function that applies, which raise an error that may be useful in some cases.
The text was updated successfully, but these errors were encountered:
Instead of supplying a single function that must work for all columns or all numeric columns, make it so one supplies either a function or a list of functions. If a function, it will be used on all columns. If a list of functions, it will use any function that matches the column name. If there is none, it will default to one for that type. This is a clever approach to handling mixed data data frames.
The default func should be something like:
list(.numeric = wtd_sum, .default = first_row)
So, given a column, it is tested for numerical status (integer or double). If yes, then the values are summed. If not, it defaults to .default and takes the first row. In this way, every column is processed. One can make it possible for there to be no function that applies, which raise an error that may be useful in some cases.
The text was updated successfully, but these errors were encountered: