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.


rstack

Stack data type as an ‘R6’ class

Project Status: Active - The project has reached a stable, usablestate and is being activelydeveloped. R-CMD-check CRAN RStudio mirrordownloads CoverageStatus

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/gaborcsardi/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"  "Species"
S$peek()
#> NULL

License

MIT © Mango Solutions, Gábor Csárdi

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.1 by Gábor Csárdi, 3 years ago


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


Report a bug at https://github.com/gaborcsardi/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 ICSS.


See at CRAN