cls: Manage Classes

View source: R/cls.R

clsR Documentation

Manage Classes

Description

Manage Classes

Usage

cls(x)

rm_cls(x, ...)

xcls(x, ...)

set_cls(x, ...)

add_cls(x, ...)

has_cls(x, ...)

Arguments

x

An R object.

...

Unquoted class names and/or names of variables whose contents are atomized and converted to character. When ... args are names of variables in the calling environment, they are atomized, otherwise they are treated as unquoted class names.

Details

  ⁠rm_cls, xcls⁠   Removes class(es) in ... from classes of x.
   
  has_cls Evaluate whether class(es) in ... are (all) classes of x.
   
  add_cls Add class(es) in ... to classes of x.
   
  set_cls Set class of x to class(es) in ....
   
  cls Gets class(es) of x.

Value

A character vector

cls

A logical scalar

has_cls

An object

⁠add_cls, set_cls, rm_cls, xcls⁠

See Also

Other properties: as_mmm(), bbb_ccc_help(), bbb_help(), bbb_mmm_prop_funs(), ccc_help(), cmp_ccc_help(), cmp_mmm_ccc_help(), cmp_mmm_help(), compatible(), ddd_prop_funs(), eee_help(), iii_help(), meets(), mmm_ccc_help(), mmm_help(), ppp_fast_help(), ppp_help(), sss_ccc_help(), sss_prop_funs(), unq_ccc_prop_funs(), unq_mmm_ccc_help(), unq_mmm_help()

Examples

egObj1 <- data.frame(letters = letters, numbers = 1:26, stringsAsFactors = F)
egObj2 <- set_cls(egObj1, c("new", cls(egObj1)))
egObj3 <- set_cls(egObj1, "new")
cls(egObj1)
cls(egObj2)
cls(egObj3)

j-martineau/uj documentation built on Sept. 14, 2024, 4:40 a.m.