Hadley Wickham's

Reshaping data with the reshape package

  • Hadley Wickham.
  • Reshaping data with the reshape package.
  • Journal of Statistical Software, vol. 21, no. 12, pp. 1––20, 2007.

Download: pre-print | from publisher


This paper presents the reshape package for R, which provides a common framework for many types of data reshaping and aggregation. It uses a paradigm of `melting' and `casting', where the data are `melted' into a form which distinguishes measured and identifying variables, and then `cast' into a new shape, whether it be a data frame, list, or high dimensional array. The paper includes an introduction to the conceptual framework, practical advice for melting and casting, and a case study.

@Article{reshape,
  author = {Hadley Wickham},
  journal = {Journal of Statistical Software},
  keywords = {reshape},
  number = {12},
  pages = {1––20},
  title = {Reshaping data with the reshape package},
  url = {http://www.jstatsoft.org/v21/i12},
  volume = {21},
  year = {2007},
  bdsk-url-1 = {http://www.jstatsoft.org/v21/i12},
}