When moving to R, one of the common questions that arises is this, how do I produce a pivot table with R? Purists of the language will probably be horrified at this question, but we do not have to be too fussy: pivot tables are an effective and convenient way to summarize and show data, and are therefore relevant to be able to perform the same summarization in our beloved language.
As you might be guessing, yes, it is actually possible to perform the same kind of summarization, even if it is not called a pivot table. But before getting into detail, let's discuss the concept. What is a pivot table?Â
We define with this concept a summary of a given detailed dataset, showing descriptive statistics of attributes stored within the dataset, aggregated by keys composed from other attributes of the same dataset.
To be clear, let&apos...