項目 | サンプル | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
列を並び替えたい(index) |
|
|||||||||||||||||||||||
列を並び替えたい(列名) |
|
|||||||||||||||||||||||
列を逆順に並び替えたい |
|
|||||||||||||||||||||||
ある列を左端と入れ替えたい(index) |
|
|||||||||||||||||||||||
ある列を右端と入れ替えたい(index) |
|
|||||||||||||||||||||||
ある列を左端と入れ替えたい(列名) |
|
|||||||||||||||||||||||
ある列を右端と入れ替えたい(列名) |
|
|
=> |
|
table("C1","C2","C3","C4","C5") = cbind(1,"C2",3,"C4","C5");
//
result = table(1,5,4,2,3);
|
=> |
|
table("C1","C2","C3","C4","C5") = cbind(1,"C2",3,"C4","C5");
//
result = table("C1","C5","C4","C2","C3");
|
=> |
|
table("C1","C2","C3","C4","C5") = cbind(1,"C2",3,"C4","C5");
//
result = table({ncol(table):1:-1});
|
=> |
|
table("C1","C2","C3","C4","C5") = cbind(1,"C2",3,"C4","C5"); // icol = 3; colIndexList = {1:ncol(table)}; colIndexListNew = rbind(icol, sel(not row=icol, colIndexList)); result = table(colIndexListNew);
|
=> |
|
table("C1","C2","C3","C4","C5") = cbind(1,"C2",3,"C4","C5"); // icol = 3; colIndexList = {1:ncol(table)}; colIndexListNew = rbind(sel(not row=icol, colIndexList), icol); result = table(colIndexListNew);
|
=> |
|
table("C1","C2","C3","C4","C5") = cbind(1,"C2",3,"C4","C5"); // colName = "C3"; colNameList = titles(table); colNameListNew = rbind(colName, sel(not belong(colNameList,colName), colNameList)); result = table(colNameListNew);
|
=> |
|
table("C1","C2","C3","C4","C5") = cbind(1,"C2",3,"C4","C5"); // colName = "C3"; colNameList = titles(table); colNameListNew = rbind(sel(not belong(colNameList,colName), colNameList), colName); result = table(colNameListNew);