forked from tidyverse/dplyr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfuns.Rd
41 lines (34 loc) · 1022 Bytes
/
funs.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/funs.R
\name{funs}
\alias{funs}
\alias{funs_}
\title{Create a list of functions calls.}
\usage{
funs(...)
funs_(dots, args = list(), env = baseenv())
}
\arguments{
\item{dots, ...}{A list of functions specified by:
\itemize{
\item Their name, \code{"mean"}
\item The function itself, \code{mean}
\item A call to the function with \code{.} as a dummy parameter,
\code{mean(., na.rm = TRUE)}
}}
\item{args}{A named list of additional arguments to be added to all
function calls.}
\item{env}{The environment in which functions should be evaluated.}
}
\description{
\code{funs} provides a flexible way to generate a named list of functions for
input to other functions like \code{summarise_each}.
}
\examples{
funs(mean, "mean", mean(., na.rm = TRUE))
# Overide default names
funs(m1 = mean, m2 = "mean", m3 = mean(., na.rm = TRUE))
# If you have function names in a vector, use funs_
fs <- c("min", "max")
funs_(fs)
}