Consider the following code.
library (reshape2) x = rnorm (20) y = x + rnorm (rnorm (20, sd = .01)) dfr <- data.frame (x, y) mlt <- melt (dfr)
When I try to cancel this operation using dcast,
dcast (mlt, value ~ variable)
I get instead a data frame with three columns (for example, not suitable for layout). How to restore the original data frame using dcast?
source share