- sort
Sort vector
examples/vectors/sort.R
numbers = c(7, 3, 9, 11, 2) sort(numbers) # 2 3 7 9 11 fruits = c("apple", "peach", "lemon", "banana", "ananas") sort(fruits) # "ananas" "apple" "banana" "lemon" "peach" sort(fruits, decreasing=TRUE) # "peach" "lemon" "banana" "apple" "ananas"