dplyr (version 0.2)

funs: Create a list of functions calls.

Description

funs provides a flexible to generate a named list of functions for input to other functions like colwise.

Usage

funs(..., env = parent.frame())

funs_q(calls, env = parent.frame())

Arguments

calls,...
A list of functions specified by:

  • Their name, "mean"
  • The function itself, mean
  • A call to the function with . as a dummy parameter, mean(., na.rm = TRUE)

env
The environment in which to evaluate calls.

Examples

Run this code
funs(mean, "mean", mean(., na.rm = TRUE))

# Overide default names
funs(m1 = mean, m2 = "mean", m3 = mean(., na.rm = TRUE))

# If you have a function names in a vector, use funs_q
fs <- c("min", "max")
funs_q(fs)

Run the code above in your browser using DataCamp Workspace