# NOT RUN {
library(dequer)
s <- stack()
for (i in 1:5) push(s, i)
### Split s into 2 stacks holding: (s) the first 3, and (s_last_2) last 2 elements
s_last_2 <- sep(s, 3)
str(s)
str(s_last_5)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab