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.
source("https://install-github.me/gaborcsardi/rstack")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
MIT © Mango Solutions, Gábor Csárdi
Need a high-speed mirror for your open-source project?
Contact our mirror admin team at info@clientvps.com.
This archive is provided as a free public service to the community.
Proudly supported by infrastructure from VPSPulse , RxServers , BuyNumber , UnitVPS , OffshoreName and secure payment technology by ArionPay.