我在R中有一个数据,如下所示,我想移动列。例如,将第三列带到第一列,反之亦然。你能帮我一下吗?例如,我希望构建具有“datathonpresevative、datathoncountry、datathon坐标等”列的新df。
我知道这个问题似乎很蠢,但我对R还不熟悉。

发布于 2022-09-01 07:56:18
library(tidyverse)
# Move the third column to first
df %>%
relocate(3)
# Subset columns
df %>%
select(datathonpresevative, datathoncountry, datathoncoordinates)https://stackoverflow.com/questions/73565518
复制相似问题