To implement the rank, order and sort function using R programming.
Returns a vector with the "rank" of each value
R Function :rank()
Returns the indices that would put the initial vector xin order.
Using order function to sort a data frame
R Function :order()
To sort a vector into acsending or descending order
R Function :sort()
#Input Vector
vect<-c(92,22,42,34,66,85,46,36,84)
#Rank Function
rank(vect)
#Order Function
order(vect)
vect[order(vect)]
#Order Using mtcars dataset
attach(mtcars)
mtcars[order(mpg),]
#Sort Function
sort(mtcars$qsec)