Stack Data Type as an 'R6' Class

An extremely simple stack data type, implemented with 'R6' classes. The size of the stack increases as needed, and the amortized time complexity is O(1). The stack may contain arbitrary objects.


Project Status: Active - The project has reached a stable, usable state and is being actively developed. Linux Build Status Windows Build status CRAN RStudio mirror downloads Coverage Status

An extremely simple stack data type, implemented with 'R6' classes. The size of the stack increases as needed, and the amortized time complexity is O(1). The stack may contain arbitrary objects.

Installation

source("https://install-github.me/MangoTheCat/rstack")

Usage

library(rstack)
S <- stack$new()
S$push(1L)
S$peek()
#> [1] 1
S$pop()
#> [1] 1
S$size()
#> [1] 0
S$push(NULL)
S$push(iris)
colnames(S$pop())
#> [1] "Sepal.Length" "Sepal.Width"  "Petal.Length" "Petal.Width" 
#> [5] "Species"
S$peek()
#> NULL

License

MIT © Mango Solutions

News

1.0.0

First public release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("rstack")

1.0.0 by Gábor Csárdi, 3 years ago


https://github.com/MangoTheCat/rstack#readme


Report a bug at https://github.com/MangoTheCat/rstack/issues


Browse source code at https://github.com/cran/rstack


Authors: Gábor Csárdi


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports R6

Suggests covr, testthat


Imported by resautonet.


See at CRAN