Learn R Programming

bandicoot (version 1.0.0)

len: Compute the length of the object

Description

Compute the length of the object

Usage

len(x, ...)

Value

An integer.

Arguments

x

Object.

...

Additional arguments needed for computing the length.

Examples

Run this code
EMAIL <- new_class(class_name = "EMAIL")
email <- EMAIL$instantiate
register_method(EMAIL, ..init.. = function(address) self$address = address)
register_method(EMAIL, ..len.. = function() nchar(self$address))

patrick <- email('patrick@test.com')
len(patrick)

Run the code above in your browser using DataLab