How to reverse a List in R?

How to reverse a List in R?

R ? Reverse a List

To reverse a list in R programming, call rev() function and pass given list as argument to it. rev() function returns returns a new list with the contents of given list in reversed order.

The syntax to reverse a list x is

rev(x)

Return Value

The rev() function returns a list.

Examples

In the following program, we take a list in x , and reverse this list using rev().

example.R

x ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download