Auxiliary function that takes in data, and assigns a group
number to all observations with the same entries in the columns
listed in the vector variables.
groupby(data, variables, groupname = ".mst.monog",
countname = ".mst.monoc", count = TRUE)data.frame to which the function will assign
groups to each row.
vector of the variable/column names in data
that will be used to determine the groups.
name of the column that will be generated to indicate the group.
name of the column that will provide a cumulative count of rows in each group.
boolean switch, set to TRUE if the column
countname should be generated.
data.frame containing an additional column
indicating the group each row falls under. If count is
set to TRUE, then an additional column counting the rows
within each group is also included.