You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sapply(rbind(dt1, dt2) , class) gives:
x y z
"integer" "factor" "factor"
sapply(rbindlist(list(dt1, dt2)) , class) gives:
x y z
"integer" "factor" "factor"
After an internal discussion, rbinding ordered with any not-ordered class should result in an ordered column (with the given ordered order and some, maybe first come first serve, order for the unordered part). ordered+ordered should result in ordered iff the orders are compatible and should result in a factor + a warning if the orders are not compatible.
The text was updated successfully, but these errors were encountered:
Submitted by: Arun ; Assigned to: Eduard Antonyan; R-Forge link
dt1 <- data.table(x=1:5, y=factor(letters[1:5], ordered=TRUE), z=factor(letters[1:5]))
dt2 <- data.table(x=6:10, y=sample(letters, 5), z=sample(letters, 5))
dt1$y is an ordered factor here. Doing:
sapply(rbind(dt1, dt2) , class) gives:
x y z
"integer" "factor" "factor"
sapply(rbindlist(list(dt1, dt2)) , class) gives:
x y z
"integer" "factor" "factor"
After an internal discussion, rbinding ordered with any not-ordered class should result in an ordered column (with the given ordered order and some, maybe first come first serve, order for the unordered part). ordered+ordered should result in ordered iff the orders are compatible and should result in a factor + a warning if the orders are not compatible.
The text was updated successfully, but these errors were encountered: