我有这个数据框:
aaa=read.table(text="variable value
X3CO 24.88994
X3CO 25.02366
X3CO 24.90309
X3CS 25.70630
X3CS 25.26748
X3CS 25.19539
X3CD 26.95723
X3CD 26.84726
X3CD 26.23144
X3CSD 36.95251
X3CSD 36.04091
X3CSD 36.90476
X5CO 25.44123
X5CO 24.97586
X5CO 24.86076
X5CS 25.71570
X5CS 26.10244
X5CS 25.39033
X5CD 27.67509
X5CD 27.18986
X5CD 26.93682
X5CSD 36.26529
X5CSD 34.88553
X5CSD 33.97910
X7CO 24.71426
X7CO 24.08444
X7CO 23.97058
X7CS 24.55734
X7CS 24.56562
X7CS 24.75898
X7CD 27.14260
X7CD 26.65704
X7CD 26.49533
X7CSD 33.89882
X7CSD 32.91092
X7CSD 32.79199
X9CO 26.86141
X9CO 26.42649
X9CO 25.83506
X9CS 28.17368
X9CS 27.27401
X9CS 26.58814
X9CD 28.88915
X9CD 28.32598
X9CD 28.27136
X9CSD 34.61352
X9CSD 35.84190
X9CSD 35.80329",header=TRUE)
您知道是否有一种方法可以使用“可变”级别将此数据帧向量化为向量?
此过程相当于手动执行此操作:
c(c(24.88994,25.02366,24.90309), c(25.70630,25.26748,25.19539),...))
corresponding to
c(c(X3CO,X3CO,X3CO),c(X3CS,X3CS,X3CS),...))