Reverse a Vector's Elements

Usage

rev(x)

Description

rev provides a reversed version of its argument. It can be used in combination with sort to obtain vectors sorted into descending order.

See Also

seq, sort.

Examples

x <- c(1:5,5:3)
# sort into descending order
rev(sort(x))
all(rev(1:7) == 7:1)#- don't need `rev' here


[Package Contents]