Stack: Stack and List classes and methods

Description Usage Arguments

View source: R/stack.R

Description

push - Append an element.

pop - Remove and return the last element.

clear - Remove all elements.

shift - Remove and return the first element.

first - Return the first element.

last - Return the last element.

size - Return the number of elements.

as.Stack - Creates a new Stack from (typically, vector) s.

as.List - Creates a new List from (typically, list) s.

Stack() - Creates and keeps a stack of items of the same type, implemented as an R vector. The type is determined by the first push operation.

List() - Creates and keeps a list of items, implemented as an R list. The type is determined by the first push operation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Default S3 method:
push(x, value)

## Default S3 method:
pop(x)

## Default S3 method:
clear(x)

## Default S3 method:
shift(x)

## Default S3 method:
first(x)

## Default S3 method:
last(x)

## Default S3 method:
size(x)

## Default S3 method:
as.Stack(s)

## Default S3 method:
as.List(s)

Stack()

List()

Arguments

x

A Stack or List object.

value

Value to append.

s

A structure to be converted to a Stack or List.



tictoc documentation built on May 19, 2017, 4:01 p.m.
Search within the tictoc package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.