The Percent pseudo-function is used to specify
a statistic that depends on other values in the table.
Usage
Percent(denom = "all", fn = percent)
Arguments
Pseudo-functions
This is a pseudo-function: it takes the form of a function call, but is
never actually called: it is
handled specially by tabular.
Details
The function fn will be called with two
arguments. The first is the usual vector of values
to which this statistic applies, and the second
is another vector of reference values, determined
by denom. The default function is percent,
defined as function(x, y) 100*length(x)/length(y).
With the default denom = "all", all values of the
analysis variable in the dataset are used as the reference. Other possibilities
are denom = "row" or denom = "col", for which
the values of the variable corresponding to the current row
or column subset are used, or a logical vector, in which
case those values are used, or anything else, which will
be passed as y.