Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 如何对表中的列重新排序_R - Fatal编程技术网

R 如何对表中的列重新排序

R 如何对表中的列重新排序,r,R,如何在R中对表的列重新排序。类是“table” 一个选项是将月.name与数据集的列名进行匹配,并将其作为索引对列进行重新排序 df1 <- booking_com_graph[,match(month.name, colnames(booking_com_graph), nomatch=0)] df1一个选项是将month.name与数据集的列名进行匹配,并将其作为索引对列进行重新排序 df1 <- booking_com_graph[,match(month.name, col

如何在R中对表的列重新排序。类是“table”


一个选项是将
月.name
与数据集的列名进行匹配,并将其作为索引对列进行重新排序

df1 <- booking_com_graph[,match(month.name, colnames(booking_com_graph), nomatch=0)]

df1一个选项是
month.name
与数据集的列名进行匹配,并将其作为索引对列进行重新排序

df1 <- booking_com_graph[,match(month.name, colnames(booking_com_graph), nomatch=0)]
df1