Repository navigation
Expand file tree
/
Copy pathfuns.Rd
More file actions
54 lines (48 loc) · 1.7 KB
/
Copy pathfuns.Rd
File metadata and controls
54 lines (48 loc) · 1.7 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/deprec-funs.R
\name{funs}
\alias{funs}
\title{Create a list of functions calls.}
\usage{
funs(..., .args = list())
}
\arguments{
\item{...}{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 argument,
\code{mean(., na.rm = TRUE)}
}
These arguments are automatically \link[rlang:quo]{quoted}. They
support \link[rlang:quasiquotation]{unquoting} and splicing. See
\code{vignette("programming")} for an introduction to these concepts.
The following notations are \strong{not} supported, see examples:
\itemize{
\item An anonymous function, \code{function(x) mean(x, na.rm = TRUE)}
\item An anonymous function in \pkg{purrr} notation, \code{~mean(., na.rm = TRUE)}
}}
\item{.args, args}{A named list of additional arguments to be added to all
function calls. As \code{funs()} is being deprecated, use other methods to
supply arguments: \code{...} argument in \link[=summarise_at]{scoped verbs} or make
own functions with \code{\link[purrr:partial]{purrr::partial()}}.}
}
\description{
\code{funs()} provides a flexible way to generate a named list of
functions for input to other functions like \code{\link[=summarise_at]{summarise_at()}}.
}
\details{
\Sexpr[results=rd, stage=render]{dplyr:::lifecycle("soft-deprecated")}
}
\examples{
funs(mean, "mean", mean(., na.rm = TRUE))
# Override 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)
# Not supported
\dontrun{
funs(function(x) mean(x, na.rm = TRUE))
funs(~mean(x, na.rm = TRUE))}
}