A simple stack for R
# install.packages("remotes")
remotes::install_github("devOpifex/stacker")
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