Learn R Programming

collections (version 0.1.0)

Stack: Stack

Description

The Stack class creates a stack with pairlist backend. It is recommended for long stack

Usage

Stack

Format

An object of class R6ClassGenerator of length 24.

Usage

Stack$new()
Stack$push(item)
Stack$pop()
Stack$size()
Stack$as_list()

Argument

  • item: any R object

See Also

StackL

Examples

Run this code
# NOT RUN {
s <- Stack$new()
s$push("first")
s$push("second")
s$pop()  # second
s$pop()  # first
# }

Run the code above in your browser using DataLab