Learn R Programming

container (version 1.0.5)

delete: Delete Container Elements Safely

Description

Search and remove elements from an object. If the element is not found, an error is signaled.

Usage

delete(.x, ...)

ref_delete(.x, ...)

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

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

Value

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

Arguments

.x

any R object.

...

elements to be deleted.

Examples

Run this code

s = setnew("a", 1:3, iris)
print(s)
delete(s, 1:3, "a")
delete(s, iris)
try({
delete(s, "b")  # "b" is not in Set
})

Run the code above in your browser using DataLab