I have a data.table with structure like this. Can I re-order the row by subject number as subject 1, subject 2, subject 3, with number from low to high?
Asked
Active
Viewed 38 times
1 Answers
1
We could change the order with mixedorder
from gtools
library(data.table)
library(gtools)
dt2 <- dt1[mixedorder(subject)]

akrun
- 874,273
- 37
- 540
- 662