Learn R Programming

container (version 1.0.5)

clear: Clear a Container

Description

Removes all elements from the container object.

Usage

clear(x)

ref_clear(x)

# S3 method for Container clear(x)

# S3 method for Container ref_clear(x)

# S3 method for dict.table clear(x)

# S3 method for dict.table ref_clear(x)

Value

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

For dict.table an object of class dict.table.

Arguments

x

any R object.

Examples

Run this code

co = container(1, 2, mean)
clear(co)
co
ref_clear(co)
co

dit = dict.table(a = 1, b = 2)
clear(dit)
dit              # original was not touched
ref_clear(dit)
dit              # original was cleared

Run the code above in your browser using DataLab