Nothing
#' @include AllClasses.R AllGenerics.R
NULL
#' @describeIn incidence Incidence of the TidySet
#' @aliases incidence
#' @return A matrix with elements in rows and sets in columns where the values
#' indicate the relationship between the element and the set.
#' @export
#' @examples
#' x <- list("a" = letters[1:5], "b" = LETTERS[3:7])
#' a <- tidySet(x)
#' incidence(a)
setMethod("incidence",
signature = signature(object = "TidySet"),
function(object) {
incidence <- matrix(0,
nrow = nElements(object),
ncol = nSets(object),
dimnames = list(
elements(object)$elements,
sets(object)$sets
)
)
rel <- unique(relations(object)[, c("sets", "elements", "fuzzy")])
elements <- as.character(rel$elements)
sets <- as.character(rel$sets)
fuzziness <- rel$fuzzy
for (p in seq_along(rel$fuzzy)) {
incidence[elements[p], sets[p]] <- fuzziness[p]
}
incidence
}
)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.