Title: | Drawing Hasse Diagram |
---|---|
Description: | Drawing Hasse diagram - visualization of transitive reduction of a finite partially ordered set. |
Authors: | Krzysztof Ciomek |
Maintainer: | Krzysztof Ciomek <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.0 |
Built: | 2024-10-24 03:27:47 UTC |
Source: | https://github.com/kciomek/hassediagram |
Drawing Hasse diagram - visualization of transitive reduction of a finite partially ordered set.
Package: | hasseDiagram |
Type: | Package |
Version: | 0.2.0 |
Date: | 2021-06-10 |
License: | MIT |
Krzysztof Ciomek
Maintainer: Krzysztof Ciomek <[email protected]>
This function generates random data for hasse
function.
generateRandomData(nrNodes, minGraphs = 1, density = 0.5)
generateRandomData(nrNodes, minGraphs = 1, density = 0.5)
nrNodes |
Numer of nodes ( |
minGraphs |
Minimal number of graphs to generate ( |
density |
Value which determines number of edges and shape of graphs ( |
nrNodes
x nrNodes
matrix.
data0_0 <- generateRandomData(15, 2, 0.0) data0_5 <- generateRandomData(15, 2, 0.5) data1_0 <- generateRandomData(15, 2, 1.0) hasse(data0_0) hasse(data0_5) hasse(data1_0)
data0_0 <- generateRandomData(15, 2, 0.0) data0_5 <- generateRandomData(15, 2, 0.5) data1_0 <- generateRandomData(15, 2, 1.0) hasse(data0_0) hasse(data0_5) hasse(data1_0)
This function draws Hasse diagram – visualization of transitive reduction of a finite partially ordered set.
hasse(data, labels = c(), parameters = list())
hasse(data, labels = c(), parameters = list())
data |
n x n matrix, which represents partial order of n
elements in set. Each cell |
labels |
Vector containing labels of elements. If missing or |
parameters |
List with named elements:
|
randomData <- generateRandomData(15, 2, 0.5) hasse(randomData) # Clustering example data <- matrix(data = FALSE, ncol = 4, nrow = 4) data[1, 2] = data[1, 3] = data[2, 4] = data[3, 4] = TRUE data[2, 3] = data[3, 2] = TRUE hasse(data, c(), list(cluster = TRUE)) hasse(data, c(), list(cluster = FALSE)) # Hasse to pdf example # randomData <- generateRandomData(15, 2, 0.5) # pdf("path-for-diagram.pdf") # hasse(randomData, NULL, list(newpage = FALSE)) # dev.off()
randomData <- generateRandomData(15, 2, 0.5) hasse(randomData) # Clustering example data <- matrix(data = FALSE, ncol = 4, nrow = 4) data[1, 2] = data[1, 3] = data[2, 4] = data[3, 4] = TRUE data[2, 3] = data[3, 2] = TRUE hasse(data, c(), list(cluster = TRUE)) hasse(data, c(), list(cluster = FALSE)) # Hasse to pdf example # randomData <- generateRandomData(15, 2, 0.5) # pdf("path-for-diagram.pdf") # hasse(randomData, NULL, list(newpage = FALSE)) # dev.off()