deque | R Documentation |
deque
creates a double ended queue.
deque(items = NULL)
items |
a list of items |
Following methods are exposed:
.$push(item) .$pushleft(item) .$pop() .$popleft() .$peek() .$peekleft() .$extend(q) .$extendleft(q) .$remove(item) .$clear() .$size() .$as_list() .$print()
item
: any R object
q
: a deque object
queue and stack
q <- deque()
q$push("foo")
q$push("bar")
q$pushleft("baz")
q$pop() # bar
q$popleft() # baz
q <- deque(list("foo", "bar"))
q$push("baz")$pushleft("bla")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.