r - 按 ASCII 顺序排列 R 中的列
问题描述
我想按 ASCII 顺序排列我的列名,这意味着所有 LARGE 字母都在 small letters 之前。
例如,我制作了以下代码:
test_ordered <- test[ , sort(names(test))]
这确实按名称对列名进行排序,如下所示:
A B d F g H
但是,我想在这里实现的是:
A B F H d g
这是sorted()
Python 的标准工作方式:
df_curr = df_curr[sorted(df_curr)]
提前致谢!
解决方案
推荐阅读
- python - 通过单击单选按钮禁用输入字段
- laravel - Laravel 控制器中的调用事件
- amazon-dynamodb - 从 JSON 或 CSV 将 50K 记录加载到 DynamoDB
- sql - POSTGRES - 使用 ON CONFLICT DO NOTHING 防止串行增量
- oracle - 提取源不包含指定的提取字段
- sql - 拆分日期范围和操作数据
- c# - 如何使用带有 onchange 方法的输入字段来更新对象的属性以写入数据?
- python - 为什么我不能从 list(itertools.count()) 中用键盘中断 Python?
- python - 如何在 Django 的选项标签中显示 Selected 选项值 Selected?
- python - (Django Rest 框架)如何更新用户模型