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, ute@imf.au.dk

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 21, 2017, 12:16 a.m.
Search within the plottools package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.