Learn R Programming

container (version 1.0.5)

count: Count Elements

Description

Count the number of occurences of some element.

Usage

count(x, elem)

# S3 method for Container count(x, elem)

# S3 method for Set count(x, elem)

Value

integer number of how many times elem occurs in the object.

Arguments

x

any R object.

elem

element to counted.

Examples

Run this code

co = container("a", "b", "a", mean, mean)
count(co, "a")
count(co, mean)
count(co, "c")

Run the code above in your browser using DataLab