len: Compute the length of the object

View source: R/oop_s3.R

lenR Documentation

Compute the length of the object

Description

Compute the length of the object

Usage

len(x, ...)

Arguments

x

Object.

...

Additional arguments needed for computing the length.

Value

An integer.

Examples

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)


bandicoot documentation built on May 29, 2024, 8:01 a.m.