reshape2 is a package that consists mainly of two functions:
acast. Generally, it could be said that
melt() transforms one row to multiple and shorter rows while
acast() do exactly the opposite.
melt() function, basically, transforms one row of data to many by pivoting a set of variables (the
measure variables) over a set of other variables (the
id variables). The function is called as follows:
id variables are usually factors or characters while the measure variables are the numeric ones. In fact, this is the behavior by default if none of the arguments are specified.
variable_name is the name that adopts the column where the variables are specified (