View source: R/as.list.rstack.R
as.list.rstack | R Documentation |
Converts an rstack to a list, where the top of the stack becomes the first element of the list, the second-from-top the second, and so on.
## S3 method for class 'rstack' as.list(x, ...)
x |
rstack to convert. |
... |
additional arguments passed to as.list after initial conversion to list. |
Runs in O(N) time in the size of the stack, but the generated list is pre-allocated for efficiency.
a list containing the elements of the stack in top-to-bottom order.
as.data.frame.rstack
s <- rstack() s <- insert_top(s, "a") s <- insert_top(s, "b") slist <- as.list(s) print(slist)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.