if (FALSE) {
clustering <- rep(1:3, each = 50)
dist_data <- as.matrix(dist(iris[, 1:4]))
dendro_iris <- adjClust(dist_data, type = "dissimilarity")
plotSim(dist_data, type = "dissimilarity", dendro = dendro_iris, axis = TRUE)
plotSim(dist_data, type = "dissimilarity", dendro = dendro_iris,
clustering = clustering)
plotSim(dist_data, type = "dissimilarity", dendro = dendro_iris, axis = TRUE,
k = 3)
plotSim(dist_data, type = "dissimilarity", legendName = "IF", axis = TRUE,
clustering = clustering)
p <- plotSim(dist(iris[, 1:4]), type = "dissimilarity", log = FALSE,
clustering = clustering, cluster_col = "blue")
# custom palette
p + scale_fill_gradient(low = "yellow", high = "red")
# dsCMatrix
m <- Matrix(c(0, 0, 2, 0, 3, 0, 2, 0, 0), ncol = 3)
res <- adjClust(m)
plotSim(m, axis = TRUE)
plotSim(m, dendro = res)
# dgCMatrix
m <- as(m, "generalMatrix")
plotSim(m)
m <- as.dist(m)
if (require("HiTC", quietly = TRUE)) {
load(system.file("extdata", "hic_imr90_40_XX.rda", package = "adjclust"))
res <- hicClust(hic_imr90_40_XX, log = TRUE)
plotSim(hic_imr90_40_XX, axis = TRUE)
}
if (requireNamespace("snpStats", quietly = TRUE)) {
data(testdata, package = "snpStats")
plotSim(Autosomes[1:200, 1:5], h = 3, stats = "R.squared", axis = TRUE,
axistext = c("A", "B", "C", "D", "E"))
}
}
Run the code above in your browser using DataLab