| shrink_to_fit | R Documentation |
Shrink the capacity of a container to its size by reference.
shrink_to_fit(x)
x |
A CppVector or CppDeque object. |
The capacity is the space, in terms of the number of elements, reserved for a container. The size is the number of elements in the container.
Invisibly returns NULL.
capacity, reserve, size.
v <- cpp_vector(4:6)
capacity(v)
# [1] 3
reserve(v, 10)
capacity(v)
# [1] 10
shrink_to_fit(v)
capacity(v)
# [1] 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.