queue: Queue

View source: R/queue.R

queueR 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()
  • item: any R object

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")

collections documentation built on Jan. 6, 2023, 1:25 a.m.