unique {cppcontainers}R Documentation

Delete consecutive duplicates

Description

Erases consecutive duplicated values from the container by reference.

Usage

unique(x, incomparables, ...)

Arguments

x

A CppForwardList or CppList object.

incomparables

Ignored.

...

Ignored.

Details

Duplicated, non-consecutive elements are not removed.

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

Value

Returns the number of deleted elements.

See Also

erase, remove., sort.

Examples

l <- cpp_forward_list(c(4, 5, 6, 6, 4))
l
# 4 5 6 6 4

unique(l)
# [1] 1
l
# 4 5 6 4


[Package cppcontainers version 1.0.0 Index]