class_add: Add new class attributes to an object

Description Usage Arguments Value Examples

View source: R/class_add.R

Description

Add new class attributes to an object

Usage

1
class_add(x, new_class)

Arguments

x

An object

new_class

(character)
A character vector with classes to add.

Value

The same object x with new classes added.

Examples

1
2
3
4
5
6
7
x <- data.frame()
y <- class_add(x, "meow")
class(y)

# The same class does not repeat if added several times
y2 <- class_add(x, c("meow" , "meow"))
class(y2)

GegznaV/spMisc documentation built on April 26, 2020, 5:59 p.m.