| StackL {collections} | R Documentation |
The StackL function creates a stack.
Pure R implementation for benchmarking.
StackL(items = NULL)
items |
a list of items |
Following methods are exposed:
.$push(item) .$pop() .$peek() .$clear() .$size() .$as_list() .$print()
item: any R object
s <- StackL()
s$push("first")
s$push("second")
s$pop() # second
s$pop() # first
s <- StackL(list("foo", "bar"))
s$push("baz")$push("bla")