Reshape three column data frame to matrix (“long” to “wide” format) [duplicate]
There are many ways to do this. This answer starts with what is quickly becoming the standard method, but also includes older methods and various other methods from answers to similar questions scattered around this site. tmp <- data.frame(x=gl(2,3, labels=letters[24:25]), y=gl(3,1,6, labels=letters[1:3]), z=c(1,2,3,3,3,2)) Using the tidyverse: The new cool new way to do this is … Read more