R/methods-methods.R

#' @importFrom methods as

methods::setClass(
  Class = "tiny_labelled"
  , contains = "vector"
)

methods::setAs(
  from = "tiny_labelled"
  , to = "numeric"
  , def = function(from) {
    as(unlabel(from), "numeric")
  }
)

methods::setAs(
  from = "tiny_labelled"
  , to = "integer"
  , def = function(from) {
    as(unlabel(from), "integer")
  }
)

Try the tinylabels package in your browser

Any scripts or data that you put into this service are public.

tinylabels documentation built on April 4, 2025, 2:02 a.m.