Sorting and Ordering
sort sorts values and order gives the positions.
Example
x <- c(3, 1, 2)
print(sort(x))
print(sort(x, decreasing = TRUE))
print(order(x))
print(rev(x))
print(rank(x))Exercise
Positions.
(x)Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.