size: Get container size

sizeR Documentation

Get container size

Description

Obtain the number of elements in a container.

Usage

size(x)

Arguments

x

A CppSet, CppUnorderedSet, CppMultiset, CppUnorderedMultiset, CppMap, CppUnorderedMap, CppMultimap, CppUnorderedMultimap, CppStack, CppQueue, CppPriorityQueue, CppVector, CppDeque, or CppList object.

Value

Returns a numeric.

See Also

bucket_count, capacity, load_factor, max_size, resize.

Examples

s <- cpp_unordered_set(4:6)
s
# 6 5 4

size(s)
# [1] 3


cppcontainers documentation built on Sept. 9, 2025, 5:55 p.m.