Create a TidySet object
These functions help to create a TidySet
object from
data.frame
, list
, matrix
, and GO3AnnDbBimap
.
They can create both fuzzy and standard sets.
tidySet(relations) ## S3 method for class 'data.frame' tidySet(relations) ## S3 method for class 'list' tidySet(relations) ## S3 method for class 'matrix' tidySet(relations) ## S3 method for class 'Go3AnnDbBimap' tidySet(relations)
relations |
An object to be coerced to a TidySet. |
Elements or sets without any relation are not shown when printed.
A TidySet object.
data.frame
: Given the relations in a data.frame
list
: Convert to a TidySet from a list
matrix
: Convert an incidence matrix into a TidySet
Go3AnnDbBimap
: Convert Go3AnnDbBimap into a TidySet object.
relations <- data.frame( sets = c(rep("a", 5), "b"), elements = letters[seq_len(6)] ) tidySet(relations) relations2 <- data.frame( sets = c(rep("A", 5), "B"), elements = letters[seq_len(6)], fuzzy = runif(6) ) tidySet(relations2) # A x <- list("A" = letters[1:5], "B" = LETTERS[3:7]) tidySet(x) # A fuzzy set taken encoded as a list A <- runif(5) names(A) <- letters[1:5] B <- runif(5) names(B) <- letters[3:7] relations <- list(A, B) tidySet(relations) # Will error # x <- list("A" = letters[1:5], "B" = LETTERS[3:7], "c" = runif(5)) # a <- tidySet(x) # Only characters or factors are allowed as elements. M <- matrix(c(1, 0.5, 1, 0), ncol = 2, dimnames = list(c("A", "B"), c("a", "b"))) tidySet(M)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.