我有一个data.frame
:colnames
A01、A02、...、A25、...、Z01、...、Z25(总共 26*25)。例如:
set.seed(1)
df <- data.frame(matrix(rnorm(26*25),ncol=26*25,nrow=1))
cols <- c(paste("0",1:9,sep=""),10:25)
colnames(df) <- c(sapply(LETTERS,function(l) paste(l,cols,sep="")))
我想要dcast
它到data.frame
26x25 (行将是 AZ 和列 01-25)。知道这个公式是dcast
什么吗?