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.

