powered by
queue creates a queue.
queue
queue(items = NULL)
a list of items
Following methods are exposed:
.$push(item) .$pop() .$peek() .$clear() .$size() .$as_list() .$print()
item: any R object
item
stack and deque
q <- queue() q$push("first") q$push("second") q$pop() # first q$pop() # second q <- queue(list("foo", "bar")) q$push("baz")$push("bla")
Run the code above in your browser using DataLab