Description Usage Arguments Details Value Author(s) Examples
apply a function to a group of rows in the input data frame (similar to the sql group by statememnt).
1 2 3 |
df |
input data frame |
groupColName |
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) |
The methods currently depend on the type of to
:
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.
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.
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.
Andrea Franceschini
1 2 3 | data(uuk_screen)
screen=add_seed(uuk_screen[1:1000,])
screen_sd = bydf(screen, groupColName="seed7", "score", sd, "sd")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.