File: plot_dendrogram.communities.Rd

package info (click to toggle)
r-cran-igraph 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,044 kB
  • sloc: ansic: 204,981; cpp: 21,711; fortran: 4,090; yacc: 1,229; lex: 519; sh: 52; makefile: 8
file content (128 lines) | stat: -rw-r--r-- 4,784 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/community.R
\name{plot_dendrogram}
\alias{plot_dendrogram}
\alias{plot_dendrogram.communities}
\title{Community structure dendrogram plots}
\usage{
plot_dendrogram(x, mode = igraph_opt("dend.plot.type"), ...)

\method{plot_dendrogram}{communities}(
  x,
  mode = igraph_opt("dend.plot.type"),
  ...,
  use.modularity = FALSE,
  palette = categorical_pal(8)
)
}
\arguments{
\item{x}{An object containing the community structure of a graph. See
\code{\link[=communities]{communities()}} for details.}

\item{mode}{Which dendrogram plotting function to use. See details below.}

\item{\dots}{Additional arguments to supply to the dendrogram plotting
function.}

\item{use.modularity}{Logical scalar, whether to use the modularity values
to define the height of the branches.}

\item{palette}{The color palette to use for colored plots.}
}
\value{
Returns whatever the return value was from the plotting function,
\code{plot.phylo}, \code{plot.dendrogram} or \code{plot.hclust}.
}
\description{
Plot a hierarchical community structure as a dendrogram.
}
\details{
\code{plot_dendrogram()} supports three different plotting functions, selected via
the \code{mode} argument. By default the plotting function is taken from the
\code{dend.plot.type} igraph option, and it has for possible values:
\itemize{ \item \code{auto} Choose automatically between the plotting
functions. As \code{plot.phylo} is the most sophisticated, that is choosen,
whenever the \code{ape} package is available. Otherwise \code{plot.hclust}
is used.  \item \code{phylo} Use \code{plot.phylo} from the \code{ape}
package.  \item \code{hclust} Use \code{plot.hclust} from the \code{stats}
package.  \item \code{dendrogram} Use \code{plot.dendrogram} from the
\code{stats} package.  }

The different plotting functions take different sets of arguments. When
using \code{plot.phylo} (\code{mode="phylo"}), we have the following syntax:
\preformatted{
    plot_dendrogram(x, mode="phylo", colbar = palette(),
            edge.color = NULL, use.edge.length = FALSE, \dots)
} The extra arguments not documented above: \itemize{
\item \code{colbar} Color bar for the edges.
\item \code{edge.color} Edge colors. If \code{NULL}, then the
\code{colbar} argument is used.
\item \code{use.edge.length} Passed to \code{plot.phylo}.
\item \code{dots} Attitional arguments to pass to \code{plot.phylo}.
}

The syntax for \code{plot.hclust} (\code{mode="hclust"}): \preformatted{
    plot_dendrogram(x, mode="hclust", rect = 0, colbar = palette(),
            hang = 0.01, ann = FALSE, main = "", sub = "", xlab = "",
            ylab = "", \dots)
} The extra arguments not documented above: \itemize{
\item \code{rect} A numeric scalar, the number of groups to mark on
the dendrogram. The dendrogram is cut into exactly \code{rect}
groups and they are marked via the \code{rect.hclust} command. Set
this to zero if you don't want to mark any groups.
\item \code{colbar} The colors of the rectangles that mark the
vertex groups via the \code{rect} argument.
\item \code{hang} Where to put the leaf nodes, this corresponds to the
\code{hang} argument of \code{plot.hclust}.
\item \code{ann}  Whether to annotate the plot, the \code{ann}
argument of \code{plot.hclust}.
\item \code{main} The main title of the plot, the \code{main} argument
of \code{plot.hclust}.
\item \code{sub} The sub-title of the plot, the \code{sub} argument of
\code{plot.hclust}.
\item \code{xlab} The label on the horizontal axis, passed to
\code{plot.hclust}.
\item \code{ylab} The label on the vertical axis, passed to
\code{plot.hclust}.
\item \code{dots} Attitional arguments to pass to \code{plot.hclust}.
}

The syntax for \code{plot.dendrogram} (\code{mode="dendrogram"}):
\preformatted{
    plot_dendrogram(x, \dots)
} The extra arguments are simply passed to \code{\link[=as.dendrogram]{as.dendrogram()}}.
}
\examples{

karate <- make_graph("Zachary")
fc <- cluster_fast_greedy(karate)
plot_dendrogram(fc)

}
\seealso{
Community detection
\code{\link{as_membership}()},
\code{\link{cluster_edge_betweenness}()},
\code{\link{cluster_fast_greedy}()},
\code{\link{cluster_fluid_communities}()},
\code{\link{cluster_infomap}()},
\code{\link{cluster_label_prop}()},
\code{\link{cluster_leading_eigen}()},
\code{\link{cluster_leiden}()},
\code{\link{cluster_louvain}()},
\code{\link{cluster_optimal}()},
\code{\link{cluster_spinglass}()},
\code{\link{cluster_walktrap}()},
\code{\link{compare}()},
\code{\link{groups}()},
\code{\link{make_clusters}()},
\code{\link{membership}()},
\code{\link{modularity.igraph}()},
\code{\link{split_join_distance}()},
\code{\link{voronoi_cells}()}
}
\author{
Gabor Csardi \email{csardi.gabor@gmail.com}
}
\concept{community}
\keyword{graphs}