需要在20000行中找到每行的等级,应用函数耗时太长

cha*_*pha 5 r apply

请帮助以下:

# create sequence of numbers
a<-matrix(0:16384,1,16385)
# fill matrix with this same sequence across 20,000 rows
b<-matrix(a,20000,ncol(a),byrow=T)
# find rank of every element, by row
c<-t(apply(b,1, function(x) rank(x, ties.method="first")))
Run Code Online (Sandbox Code Playgroud)

这只是一个样本,b将具有随机序列.

以下是输出的示例:如果b有这个(现在2行乘3列):

1 5 10
2 1 6
Run Code Online (Sandbox Code Playgroud)

我希望这在我的输出中:

1 2 3
2 1 3
Run Code Online (Sandbox Code Playgroud)

处理需要很长时间.请帮忙.

谢谢.