as.list.rpqueue {rstackdeque} | R Documentation |
Converts an rpqueue to a list, where the front of the queue becomes the first element of the list, the second-from-front the second, and so on.
## S3 method for class 'rpqueue'
as.list(x, ...)
x |
rpqueue to convert. |
... |
additional arguments passed to as.list after initial conversion to list. |
Runs in O(N)
time in the size of the rpqueue, but the generated list is pre-allocated for efficiency.
a list containing the elements of the rpqueue in front-to-back order.
as.data.frame.rpqueue
and the generic as.list
.
q <- rpqueue()
q <- insert_back(q, "a")
q <- insert_back(q, "b")
qlist <- as.list(q)
print(qlist)