Add or remove S3 cpass labels.

add_class_label(x, new_class)

remove_class_label(x, drop_class)

Arguments

x

An object to modify.

new_class

(character)
A name of a new class. May be a vector of names.

drop_class

(character)
A name of a class to remove. May be a vector of names.

Examples

add_class_label(list("ok"), "ok_list")
#> [[1]] #> [1] "ok" #> #> attr(,"class") #> [1] "ok_list" "list"