Learn R Programming

rstackdeque (version 1.1.1)

peek_back<-: Assign to/modify the back of an rdeque

Description

Allows modification access to the back of a deque.

Usage

peek_back(d, ...) <- value

Arguments

d
rdeque to modify the back element of.
...
additional arguments to be passed to or from methods.
value
value to assign to the back data element.

Value

modified rdeque.

Details

Runs in $O(1)$ worst case time. Throws an error if the deque is empty.

See Also

peek_back.rdeque for accessing the back element.

Examples

Run this code
d <- rdeque()
d <- insert_front(d, data.frame(a = 1, b = 1))
d <- insert_front(d, data.frame(a = 1, b = 1))

peek_back(d)$a <- 100
print(d)

peek_back(d) <- data.frame(a = 100, b = 100)

Run the code above in your browser using DataLab