# first remember the names
n <- df.aree$name
# transpose all but the first column (name)
df.aree <- as.data.frame(t(df.aree[,-1]))
colnames(df.aree) <- n
df.aree$myfactor <- factor(row.names(df.aree))
str(df.aree) # Check the column types
REF:
https://stackoverflow.com/questions/6778908/transpose-a-data-frame
标签:语言,转置,REF,frame,Transpose,data
From: https://www.cnblogs.com/emanlee/p/7655399.html