DF = data.frame( year=as.factor( 2003:2007 ), first=c( -5.29, 4.96, 0.11, 5.30, 1.71 ), second=c( 8.62, 1.06, 0.58, 0.82, 5.41 ), third=c( 5.23, -0.25, 5.46, 4.81, -1.92 ), fourth=c( 6.44, 6.32, 3.01, 6.54, -4.78 ) ) library(reshape2) DF_melt = melt(DF, id.vars=c('year'), value.name='return', variable.name='quarter')