# NOT RUN {
# construct data frame
mydata <- read.table(text="Severity Description
1 Mild
4 Moderate
3 Moderate
2 Mild
1 Severe", header=TRUE)
# sort the data frame called mydata according to Severity
# in ascending order
mydata <- Sort(Severity)
# abbreviated form, replace original with sorted
mydata <- srt(Severity)
# sort Description in descending order, sort Severity within
# each level of Description in ascending order
mydata <- Sort(c(Description, Severity), direction=c("-", "+"))
# data in a different data frame than mydata
data(dataEmployee)
mydata <- Sort(Gender, data=dataEmployee)
# sort by row names in ascending order
mydata <- Read("Employee", format="lessR")
mydata <- Sort(row.names)
# randomly re-shuffle the rows of data
mydata <- Read("Employee", format="lessR")
mydata <- Sort(random)
# }
Run the code above in your browser using DataLab