R/brackets_R6.R

Defines functions length.ConceptSet as.list.ConceptSet `[.Set` `[.ImplicationSet` `[.ConceptSet`

#' @export
#' @noRd
`[.ConceptSet` <- function(x, ...) x$`[`(...)
#' @export
#' @noRd
`[.ImplicationSet` <- function(x, ...) x$`[`(...)
#' @export
#' @noRd
`[.Set` <- function(x, ...) x$`[`(...)

#' @export
#' @method as.list ConceptSet
#' @noRd
as.list.ConceptSet <- function(x, ...) {

  if ("to_list" %in% names(x)) {

    return(x$to_list())

  } else {

    stop("Cannot convert R6 class to list...")

  }

}

#' @export
#' @method length ConceptSet
#' @noRd
length.ConceptSet <- function(x, ...) {

  x$size()

}

Try the fcaR package in your browser

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

fcaR documentation built on June 29, 2021, 1:06 a.m.