DF = data.frame( batch=as.factor( 1:7 ), without=c( 1.10, 1.05, 1.08, 0.98, 1.01, 0.96, 1.02 ), with=c( 1.06, 1.02, 1.17, 1.21, 1.01, 1.23, 1.19 ) ) library(reshape2) DF_melt = melt(DF, id.vars=c('batch'), value.name='sumens', variable.name='additive')