【发布时间】:2014-04-06 07:17:42
【问题描述】:
我想更改data.frame 中rows 和columns 的顺序。我使用了transpose,但它没有按预期工作。我是 plyr 包中的 apply/ddply 的新手。
这是输入。
Destination S1 S2 S3 S4
Section_A NA NA NA NA
County1 94 82 121 148
County2 95 87 127 159
County3 96 98 139 182
County4 102 95 142 182
Section_B NA NA NA NA
County5 120 122 187 254
County6 119 121 185 251
County7 119 121 185 251
County8 114 116 175 236
County9 109 111 165 221
County10 110 112 167 224
Section_C NA NA NA NA
County11 47 41 33 19
County12 43 36 24 5
County13 143 191 279 415
County14 144 126 215 286
County15 142 135 222 302
我期待这样的事情:
Destination S1 S2 S3 S4
Section_A County1 94 82 121 148
Section_A County2 95 87 127 159
Section_A County3 96 98 139 182
Section_A County4 102 95 142 182
Section_B County5 120 122 187 254
Section_B County6 119 121 185 251
Section_B County7 119 121 185 251
Section_B County8 114 116 175 236
Section_B County9 109 111 165 221
Section_B County10 110 112 167 224
Section_C County11 47 41 33 19
Section_C County12 43 36 24 5
Section_C County13 143 191 279 415
Section_C County14 144 126 215 286
Section_C County15 142 135 222 302
有人可以调查一下并帮助我吗?
提前致谢。
【问题讨论】: