sumnum {easyr}R Documentation

Summarize All Numeric Columns

Description

Easily summarize at all numeric variables. Helpful for flexibly summarizing without knowing the columns. Defaults to sum but you can send a custom function through also. Typically pass in a data frame after group_by.

Usage

sumnum(x, do.fun = NULL, except = c(), do.ungroup = TRUE, ...)

Arguments

x

Grouped tibble to summarize.

do.fun

Function to use for the summary. Passed to dplyr::summarize(). Can be a custom function. Defaults to sum().

except

Columns names, numbers, or a logical vector indicating columns NOT to summarize.

do.ungroup

Run dplyr::ungroup() after summarizing the prevent future issues with grouping.

...

Extra args passed to dplyr::summarize() which are applied as arguments to the function passed in do.fun.

Value

Summarized data frame or tibble.

Examples


require(dplyr)
require(easyr)

sumnum( group_by( cars, speed ) )
sumnum( group_by( cars, speed ), mean )
sumnum( cars )


[Package easyr version 0.5-11 Index]