aggregate_to_pref_suff_byname function

Aggregate a matrix to prefixes or suffixes of row and/or column names