Learn R Programming

cppcontainers (version 1.0.4)

push_back: Add an element to the back

Description

Add an element to the back of a container by reference.

Usage

push_back(x, value)

Value

Invisibly returns NULL.

Arguments

x

A CppVector, CppDeque, or CppList object.

value

A value to add to x.

See Also

back, emplace_back, insert, pop_back, push_front.

Examples

Run this code
v <- cpp_vector(4:6)
v
# 4 5 6

push_back(v, 14L)
v
# 4 5 6 14

Run the code above in your browser using DataLab