Possible solution
This function seems to be working well. I have edited it to incorporate input.
multi.mixedorder <-\(data, cols, na.last = TRUE, decreasing = FALSE) {
do.call(order, c(
lapply(cols, function(col) {
if (is.character(data[[col]])) {
factor(data[[col]], levels = mixedsort(unique(data[[col]])))
} else {
data[[col]]
}
}),
list(na.last = na.last, decreasing = decreasing)
))
}
DT[multi.mixedorder(DT, input),]