Skip to contents

Similar to rev but faster.

Usage

frev(x)

Arguments

x

An atomic vector or list.

Details

Similar to rev, frev only retains three attributes: names, class, and factor levels.

Value

Returns the input reversed.

Examples

# on vectors
x = setNames(1:10, letters[1:10])
frev(x)
#>  j  i  h  g  f  e  d  c  b  a 
#> 10  9  8  7  6  5  4  3  2  1 

# list
frev(list(1, "a", TRUE))
#> [[1]]
#> [1] TRUE
#> 
#> [[2]]
#> [1] "a"
#> 
#> [[3]]
#> [1] 1
#>