Notice only grouping columns and columns passed through an aggregating calculation (such as
max()) are passed through (the columnzis not in the result). Now becauseyis a function ofxno substantial aggregation is going on, we call this situation a “pseudo aggregation” and we have taught this before. This is also why we made the seemingly strange choice of keeping the variable namey(instead of picking a new name such asmax_y), we expect theyvalues coming out to be the same as the one coming in- just with changes of length. Pseudo aggregation (using the projectiony[[1]]) was also used in the solutions of the column indexing problem.Our
wraprpackage now supplies a special case pseudo-aggregator (or in a mathematical sense: projection):psagg(). It works as follows.
In this post, John calls the act of grouping functional dependencies (where we can determine the value of y based on the value of x, for any number of columns in y or x) pseudo-aggregation.