Learn R Programming

cppcontainers (version 1.0.4)

assign: Replace all elements

Description

Replace all elements in a container by reference.

Usage

assign(x, value, pos, envir, inherits, immediate)

Value

Invisibly returns NULL.

Arguments

x

A CppVector, CppDeque, CppForwardList, or CppList object.

value

A vector. It is called value instead of values for compliance with the generic base::assign method.

pos

Ignored.

envir

Ignored.

inherits

Ignored.

immediate

Ignored.

Details

Replaces all elements in x with the elements in value.

The parameters pos, envir, inherits, and immediate are only included for compatibility with the generic base::assign method and have no effect.

See Also

emplace, emplace_after, emplace_back, emplace_front, insert, insert_after, insert_or_assign.

Examples

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

assign(v, 12:14)
v
# 12 13 14

Run the code above in your browser using DataLab