.\" -*- nroff -*- generated from .Rd format
.BG
.FN gapply
.TL
Apply a Function by Groups
.DN
Applies the function to the distinct sets of rows of the data frame
defined by `groups'.
.CS
gapply(object, which, FUN, form, level, groups, ...)
.RA
.AG object
an object to which the function will be applied - usually
a `groupedData' object or a `data.frame'.

.AG FUN
function to apply to the distinct sets of rows
of the data frame `object' defined by the values of
`groups'.
.OA
.AG which
an optional character or positive integer vector specifying which
columns of `object' should be used with `FUN'. Defaults to all columns
in `object'. 
.AG form
an optional one-sided formula that defines the groups.
When this formula is given the right-hand side is evaluated in
`object', converted to a factor if necessary, and the unique
levels are used to define the groups.  Defaults to
`formula(object)'.

.AG 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.

.AG groups
an optional factor that will be used to split the 
rows into groups.  Defaults to `getGroups(object, form, level)'.

.AG ...
optional additional arguments to the summary function
`FUN'.  Often it is helpful to specify `na.rm = TRUE'.

.RT
Returns a data frame with as many rows as there are levels in the
`groups' argument.

.SA
`gsummary'
.EX
## Find number of non-missing "conc" observations for each Subject
gapply( Quinidine, FUN = function(x) sum(!is.na(x$conc)) )
.KW data
.WR
