name of the column to be used for grouping the rows (character vector)
valColName
name of the column containing the values to be inserted in the function (character vector)
fun
function to be applied (function)
newColName
name of the colum that contains the result of the function (character vector)
Value
bydf: data frame with the function applied to the grouping
bydfa: input data frame with an additional column with the results of the function applied to the grouping.
Details
The methods currently depend on the type of to:
bydf
apply a function to a group of rows in the input data frame (similar to the sql group by statememnt).
Put the results of this function in a new data frame that is returned as output.
bydfa
apply a function to a group of rows in the input data frame (similar to the sql group by statememnt).
return the same data frame with an additional column with the results of the function.