Description Usage Arguments Value Author(s) References See Also Examples
Applies the function to the distinct sets of rows of the data frame
defined by groups
.
1 
object 
an object to which the function will be applied  usually
a 
which 
an optional character or positive integer vector
specifying which columns of 
FUN 
function to apply to the distinct sets of rows
of the data frame 
form 
an optional onesided formula that defines the groups.
When this formula is given the righthand side is evaluated in

level 
an optional positive integer giving the level of grouping to be used in an object with multiple nested grouping levels. Defaults to the highest or innermost level of grouping. 
groups 
an optional factor that will be used to split the
rows into groups. Defaults to 
... 
optional additional arguments to the summary function

Returns a data frame with as many rows as there are levels in the
groups
argument.
Jos<c3><a9> Pinheiro and Douglas Bates bates@stat.wisc.edu
Pinheiro, J.C., and Bates, D.M. (2000) "MixedEffects Models in S and SPLUS", Springer, esp. sec. 3.4.
1 2 3 4 5 6 7  ## Find number of nonmissing "conc" observations for each Subject
gapply( Phenobarb, FUN = function(x) sum(!is.na(x$conc)) )
# Pinheiro and Bates, p. 127
table( gapply(Quinidine, "conc", function(x) sum(!is.na(x))) )
changeRecords < gapply( Quinidine, FUN = function(frm)
any(is.na(frm[["conc"]]) & is.na(frm[["dose"]])) )

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs in the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.