| resize | R Documentation |
Alter the size of the container by reference.
resize(x, size, value = NULL)
x |
A |
size |
The new size of the container. |
value |
The value of new elements. It defaults to |
If the new size is larger than the former size, the function sets newly added elements in the back to value.
Invisibly returns NULL.
v <- cpp_vector(4:9)
v
# 4 5 6 7 8 9
size(v)
# 6
resize(v, 10)
v
# 4 5 6 7 8 9 0 0 0 0
resize(v, 3)
v
# 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.