Notice only grouping columns and columns passed through an aggregating calculation (such as
max()
) are passed through (the columnz
is not in the result). Now becausey
is a function ofx
no 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 they
values 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
wrapr
package 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.