ggclust: plot the result of hierarchical cluster analysis for the...

View source: R/plot-ggclust.R

ggclustR Documentation

plot the result of hierarchical cluster analysis for the samples

Description

plot the result of hierarchical cluster analysis for the samples

Usage

ggclust(obj, ...)

## S3 method for class 'treedata'
ggclust(
  obj,
  layout = "rectangular",
  factorNames = NULL,
  factorLevels = NULL,
  pointsize = 2,
  fontsize = 2.6,
  hjust = -0.1,
  ...
)

Arguments

obj

R object, treedata object.

...

additional params, see also geom_tippoint

layout

character, the layout of tree, see also ggtree.

factorNames

character, default is NULL.

factorLevels

list, default is NULL.

pointsize

numeric, the size of point, default is 2.

fontsize

numeric, the size of text of tiplabel, default is 2.6.

hjust

numeric, default is -0.1

Value

the figures of hierarchical cluster.

Author(s)

Shuangbin Xu

Examples

## Not run: 
library(phyloseq)
library(ggtree)
library(ggplot2)
data(GlobalPatterns)
subGlobal <- subset_samples(GlobalPatterns,
         SampleType %in% c("Feces", "Mock", "Ocean", "Skin"))
hcsample <- get_clust(subGlobal, distmethod="jaccard",
                  method="hellinger", hclustmethod="average")
hc_p <- ggclust(hcsample, layout = "rectangular",
                pointsize=1, fontsize=0,
                factorNames=c("SampleType")) +
        theme_tree2(legend.position="right",
                    plot.title = element_text(face="bold", lineheight=25,hjust=0.5))

## End(Not run)

YuLab-SMU/MicrobiotaProcess documentation built on Nov. 8, 2024, 4:37 p.m.