What is the most simple way of creating a data table from a data frame containing the information?
set.seed(1); atable <- data.frame(rows = c(rep("row1",3), rep("row2",3), rep("row3",3)),
columns = c("col1", "col2", "col3"), values = runif(9))
> atable
rows columns values
1 row1 col1 0.96787365
2 row1 col2 0.53987921
3 row1 col3 0.48461553
4 row2 col1 0.42281684
5 row2 col2 0.34441145
6 row2 col3 0.06374566
7 row3 col1 0.44141985
8 row3 col2 0.39764457
9 row3 col3 0.56511001
The result should be a 3x3 table or matrix.
Thanks