I have a data frame
newDF<-data.frame(type=c(rep("A",4),
rep("B",2),rep("C",3),
rep("D",4),rep("E",4)),
cluster=sample(1:4,17,replace=T),
count=sample(1:20, 17, rep=T),
sum=sample(30:1000,17,rep=T))
And I need to get 2 new data frames, which would have "cluster" as columns, type as rows and count as fill.(second table will be the same, but fill=sum, not count). There must be some NA's in these 2 tables, because newDF has 17 rows, but two new data frames must be 5x5
How can I create these 2 5x5 data frames?
I'm sorry, I have already found answer