R - 从大到小排列

标签 r sorting dataframe

我正在使用 Rank()为数据帧分配排名值,但是我需要排名为 1 = 最高而不是 1 = 最低。

最佳答案

如果你想获得x的排名从大到小,做

rank(-x)

关于R - 从大到小排列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26423493/

相关文章:

r-ggplot2 : connecting points in polar coordinates with a straight line

Java选择排序

java - 这种类型存在吗?

python - 如何在迭代pandas期间将行移动到新的df中

python - 在 pandas 数据框中从 "Year-month-date"格式中删除年份

r - 更有效的方式:selecting vec from a list

r - 将第 N 行的 NA 行插入到列表中的数据帧列表中,其中 N 来自列表

python/pandas 从开始日期+时间,创建日期时间索引

r - R 的代理设置

c++ - 程序跳过 std::getline