Learn R Programming

cppcontainers (version 1.0.4)

sort: Sort elements

Description

Sorts the elements in a container by reference.

Usage

sort(x, decreasing, ...)

Value

Invisibly returns NULL.

Arguments

x

A CppForwardList or CppList object.

decreasing

Ignored.

...

Ignored.

Details

decreasing and ... are only included for compatibility with the generic base::sort method and have no effect.

See Also

sorting, unique.

Examples

Run this code
l <- cpp_forward_list(c(3, 2, 4))
l
# 3 2 4

sort(l)
l
# 2 3 4

Run the code above in your browser using DataLab