firstclass-set: Add a class in first place

Description Usage Arguments Value Author(s) Examples

Description

Add a new class name to the classes of an R object, and make it the first in the list of classes the objects belongs to.

Usage

1
  firstclass(x) <- value

Arguments

x

the object the new class is assigned to. Needs to be an object that can be copied.

value

character string with the new class name.

Value

The same object x, now belonging (additionally) to the class given as "value".

Author(s)

Ute Hahn, [email protected]

Examples

1
2
3
4
5
x <- data.frame(u = 1:2, t = 3:4)
class(x)
firstclass(x) <- "my.first.class"
class(x)
firstclass(x) <- "data.frame"

plottools documentation built on May 31, 2017, 1:35 a.m.