queue creates a queue.

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

Examples

q <- queue()
q$push("first")
q$push("second")
q$pop()  # first
#> [1] "first"
q$pop()  # second
#> [1] "second"

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