queue {collections}R Documentation

Queue

Description

queue creates a queue.

Usage

queue(items = NULL)

Arguments

items

a list of items

Details

Following methods are exposed:

.$push(item)
.$pop()
.$peek()
.$clear()
.$size()
.$as_list()
.$print()

See Also

stack and deque

Examples

q <- queue()
q$push("first")
q$push("second")
q$pop()  # first
q$pop()  # second

q <- queue(list("foo", "bar"))
q$push("baz")$push("bla")

[Package collections version 0.3.7 Index]