Learn R Programming

dequer (version 2.0-2)

as.stack: Convert to Stack

Description

Convert to Stack

Usage

as.stack(x)

# S3 method for list as.stack(x)

# S3 method for default as.stack(x)

# S3 method for deque as.stack(x)

# S3 method for queue as.stack(x)

Arguments

x

An object either to be converted to the first element of a stack (default), or the elements of a list (or columns of a dataframe) to be set as elements of a stack.

Value

A stack object.

Examples

Run this code
# NOT RUN {
library(dequer)
s <- as.stack(lapply(1:5, identity))
s
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab