forked from hadley/plyr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheach.Rd
36 lines (35 loc) · 985 Bytes
/
each.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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/each.r
\name{each}
\alias{each}
\title{Aggregate multiple functions into a single function.}
\usage{
each(...)
}
\arguments{
\item{...}{functions to combine. each function should produce a single
number as output}
}
\description{
Combine multiple functions into a single function returning a named vector
of outputs.
Note: you cannot supply additional parameters for the summary functions
}
\examples{
# Call min() and max() on the vector 1:10
each(min, max)(1:10)
# This syntax looks a little different. It is shorthand for the
# the following:
f<- each(min, max)
f(1:10)
# Three equivalent ways to call min() and max() on the vector 1:10
each("min", "max")(1:10)
each(c("min", "max"))(1:10)
each(c(min, max))(1:10)
# Call length(), min() and max() on a random normal vector
each(length, mean, var)(rnorm(100))
}
\seealso{
\code{\link{summarise}} for applying summary functions to data
}
\keyword{manip}