liveBook · Manning

Wide format

As explained in Statistics Slam Dunk

Wide format is a tabular arrangement in which repeated measurements or categories are represented by separate columns.

Wide format arranges repeated measurements or categories across separate columns. Each row can represent one entity, while columns such as s2017 through s2000 hold values for different seasons. section 2.7 section 2.1

This arrangement can be convenient for reading or calculating across many measurements, but analysis and visualization often require a long format with one measurement per row. R can reshape wide data with reshape2 or dplyr and tidyr tools. section 2.1 section 2.7

A practical wide-format workflow includes:

  • Identify measurement columns that encode categories such as seasons. section 10.3

NBA salaries by season

A salaries table stores average salary measures in columns named s2017 through s2000. The following reshapes those columns into year and real columns: salaries %>% pivot_longer(col = c(s2017:s2000), names_to = "year", values_to = "real"). The result has 18 rows and two columns, making it suitable for a season-by-season line chart.

How Statistics Slam Dunk covers it

How deep it goes
Defines column-based organization and works through salary reshaping, but does not develop formal data-model theory.
Examples
Uses NBA salary-cap, real salary, inflation-adjusted salary, and playoff-classification columns across multiple seasons.
What it assumes
Assumes familiarity with rectangular rows and columns while introducing package loading and wide-to-long transformation.
What you can do after
Apply it via dplyr and pivot_longer() to convert season columns into chart-ready long data.
How it connects
Connects data wrangling with long format, pivoting, dplyr, tidyr, reshape2, and ggplot2 visualization.

Also explained in

Compare how 2 books explain wide format →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Slam Dunk. The section links point to the parts of the book it draws on.