Reshape2 and Tidyr

Xianjun Dong, PhD
2018/02/12

In short

  • Reshape2 is an R package written by Hadley Wickham that makes it easy to transform data between wide and long formats.
  • tidyr replaces reshape2 (2010-2014) and reshape (2005-2010).
  • tidyr is designed specifically for tidying data, not general reshaping (reshape2), or the general aggregation (reshape).

In short

For more details on authoring R presentations please visit https://support.rstudio.com/hc/en-us/articles/200486468.

  • Bullet 1
  • Bullet 2
  • Bullet 3

Slide With Code

summary(cars)
     speed           dist       
 Min.   : 4.0   Min.   :  2.00  
 1st Qu.:12.0   1st Qu.: 26.00  
 Median :15.0   Median : 36.00  
 Mean   :15.4   Mean   : 42.98  
 3rd Qu.:19.0   3rd Qu.: 56.00  
 Max.   :25.0   Max.   :120.00  

Slide With Plot

plot of chunk unnamed-chunk-2