combine | R Documentation |
Combine two objects (queue/stack/deque) into one of the same type.
combine(x1, x2)
x1, x2 |
Two different deques, stacks, or queues. Arguments must be of the same type. |
Operates via side-effects; see examples for clarification on usage.
Returns NULL
. After combining, object x2
is a 0-length (empty)
object.
## Not run: library(dequer) s1 <- stack() for (i in 1:5) push(s1, i) s2 <- stack() for (i in 10:8) push(s2, i) combine(s1, s2) s1 # now holds all 8 elements s2 # holds 0 elements ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.