R/methods.R

Defines functions is.multiby_crosstable is.compacted_crosstable is.transposed_crosstable is.crosstable

Documented in is.compacted_crosstable is.crosstable is.multiby_crosstable is.transposed_crosstable

utils::globalVariables(c(".id", "variable", "name"))

# Utils -------------------------------------------------------------------


#' Test if an object is a crosstable
#'
#' @param x An object
#'
#' @return TRUE if the object inherits from the `crosstable` class or other subclasses.
#' @export
is.crosstable = function(x) {
  inherits(x, "crosstable")
}

#' @rdname is.crosstable
#' @export
is.transposed_crosstable = function(x) {
  inherits(x, "transposed_crosstable")
}

#' @rdname is.crosstable
#' @export
is.compacted_crosstable = function(x) {
  inherits(x, "compacted_crosstable")
}

#' @rdname is.crosstable
#' @export
is.multiby_crosstable = function(x) {
  inherits(x, "crosstable_multiby")
}

Try the crosstable package in your browser

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

crosstable documentation built on Nov. 13, 2023, 1:08 a.m.