我想重新组织我的数据框。我只是想将最后一列移到第一位,其余列以相同的顺序离开。我使用函数子集来做到这一点。它有效,但如果我有 100 列左右,那会很痛苦。有没有更简单的方法呢?
tbl_comp <- subset(tbl_comp, select=c("Description","Meve_mean","Mmor_mean", "Mtot_mean", "tot_meanMe", "tot_meanMm", "tot_sdMe", "tot_sdMm", "Wteve_mean", "Wtmor_mean", "Wttot_mean", "tot_meanwte", "tot_meanwtm", "tot_sdwte", "tot_sdwtm"))