These methods are side-effect free. Note that unlike R's head() and
tail(), the sub-objects are not actually created. They are merely
printed to the terminal.
Usage
peek(x, n = 1L)
# S3 method for deque
peek(x, n = 1L)
# S3 method for queue
peek(x, n = 1L)
# S3 method for stack
peek(x, n = 1L)
peekback(x, n = 1L)
# S3 method for deque
peekback(x, n = 1L)
# S3 method for queue
peekback(x, n = 1L)
# S3 method for stack
peekback(x, n = 1L)
Arguments
x
A queue, stack, or deque.
n
The number of items to view.
Value
Returns NULL; sub-elements are only printed.
Details
View items from the front (peek()) or back (peekback()) of a
queue, stack, or deque.