Learn R Programming

gmwm (version 2.0.0)

reverse_vec: Reverse Armadillo Vector

Description

Reverses the order of an Armadillo Vector

Usage

reverse_vec(x)

Arguments

x
A column vector of length N

Value

x A column vector with its contents reversed.

Details

Consider a vector x=[1,2,3,4,5], the function would output x=[5,4,3,2,1].

Examples

Run this code
x = 1:5
reverse_vec(x)

Run the code above in your browser using DataLab