/stacker

Simple stack for R

Primary LanguageRGNU General Public License v3.0GPL-3.0

stacker

A simple stack for R

# install.packages("remotes")
remotes::install_github("devOpifex/stacker")

Example

This is a basic example which shows you how to solve a common problem:

library(stacker)

s <- Stack$new()

s$push(1)
s$push(2)
s$push(3)

s$read()
#> [[1]]
#> [1] 1
#> 
#> [[2]]
#> [1] 2
#> 
#> [[3]]
#> [1] 3

s$pop()

s$top()
#> [1] 2
s$read()
#> [[1]]
#> [1] 1
#> 
#> [[2]]
#> [1] 2