d.frm <- d.pizza[1:10, c("driver","temperature","delivery_min")]
Sort(d.frm[,1])
# Sort follows the levels by default
levels(d.frm[,1])
Sort(x=d.frm, ord="driver", decreasing=FALSE)
# set factorsAsCharacter = TRUE, if alphabetical order is required
Sort(x=d.frm, ord="driver", decreasing=FALSE, factorsAsCharacter=TRUE)
Sort(x=d.frm, ord=c("driver","delivery_min"), factorsAsCharacter = TRUE)
Sort(x=d.frm, ord=c("driver","delivery_min"), factorsAsCharacter = FALSE)
Sort(x=d.frm, ord=c("driver","delivery_min"), decreasing=c(FALSE, TRUE),
factorsAsCharacter = FALSE)
# Sorting tables
tab <- table(d.pizza$driver, d.pizza$area)
Sort(x=tab, ord=c(0,2), decreasing=c(TRUE, FALSE))
Sort(x=tab, ord=2, decreasing=TRUE)
# partial matching ok:
Sort(tab, o=1, d=TRUE)
Run the code above in your browser using DataLab