Import reshape2 instead of reshape
Fix variable_name -> variable.name

Thanks Dieter Menne for pointing this out.
Automatic reorder by Roxygen2
Replace cast() by dcast() from reshape2
Replace X1/X2 by Var1/Var2

reshape2's melt() names its columns Var1/Var2
while reshape used to name them X1/X2