Learn R Programming

container (version 1.0.5)

discard: Discard Container Elements

Description

Search and remove an element from an object. If the element is not found, ignore the attempt.

Usage

discard(.x, ...)

ref_discard(.x, ...)

# S3 method for Container discard(.x, ...)

# S3 method for Container ref_discard(.x, ...)

Value

For Container, an object of class Container (or one of the respective derived classes).

Arguments

.x

any R object.

...

elements to be discarded.

Examples

Run this code

s = setnew("a", num = 1:3, data = iris)
print(s)
discard(s, 1:3, "a")
discard(s, iris)
discard(s, "b")  # ignored

Run the code above in your browser using DataLab