Executes an R expression using variables from the dataset, possibly separately for each level of a given varlist (like the by prefix in Stata).
Usage
do(expr, by = NULL)
Arguments
expr
an R expression which can use any of the variable names in the current dataset
by
a variable list in either "var1 var2 var3" format or in ~var1+var2+var3 format. The R expression will be applied separately for the data subsetted to each level of the variable list.