【发布时间】:2013-03-19 12:54:18
【问题描述】:
原来如此简单,谢谢。
我想不出一个通用函数可以帮助我对嵌入函数的结果矩阵进行排序。
例如:
moustache <- embed(c(1:4),3)
moustache
[,1] [,2] [,3]
[1,] 3 2 1
[2,] 4 3 2
I would rather like the matrix :
[,1] [,2] [,3]
[1,] 1 2 3
[2,] 2 3 4
感谢您的帮助。
【问题讨论】:
-
目前还不清楚,您的排序规则实际上是什么。也许你想要
moustache[,order(moustache[1,])]。 -
井嵌入给了我一个反向时间序列,我只想把它放回原来的顺序