data.table
is a powerful tool for exploring data.
Here we provides a example for melting and casting data.
Code:
1 | library(data.table) |
cast
can change raw data into a wide table and melt
can change data in wide table format back to raw data. I think that it is faster and easier than other functions on data.frame
. (Some functions like reshape
, cast
and melt
in reshape
.)