rmini (version 0.0.4)

+.Foo: Add a new element to a list

Description

This is an S3 generic function for + with the class Foo.

Usage

"+"(x, y)

Arguments

x
a list with class Foo
y
an arbitrary R object

Value

A list with y being added to x as its last element.

Examples

Run this code
structure(list(1), class = "Foo") + 2

z = list("a")
class(z) = "Foo"
z + letters
z + 5 + matrix(1:4, 2)  # you can add arbitrary objects to z

methods("+")  # check the methods on +

Run the code above in your browser using DataLab