## S3 method for class 'communities':
dendPlot(x, mode = getIgraphOpt("dend.plot.type"),
..., use.modularity = FALSE)communities object, the community
structure, as returned by some igraph community detection function.FALSE for undirected graphs, for technical readons.plot.phylo, plot.dendrogram or plot.hclust.dendPlot supports three different plotting functions, selected
via the mode argument. By default the plotting function is
taken from the dend.plot.type igraph option, and it has for
possible values: autoChoose automatically between the plotting
functions. Asplot.phylois the most sophisticated, that is
choosen, whenever theapepackage is available. Otherwiseplot.hclustis used.phyloUseplot.phylofrom theapepackage.hclustUseplot.hclustfrom thestatspackage.dendrogramUseplot.dendrogramfrom thestatspackage. The different plotting functions take different sets of
arguments. When using plot.phylo (mode="phylo"), we have
the following syntax: dendPlot(communities, mode="phylo",
colbar = rainbow(length(communities)),
col = colbar[membership(communities)],
mark.groups = communities(communities),
edge.color = "#AAAAAAFF", edge.lty = c(1,2), \dots,
use.modularity = FALSE) The extra arguments not documented above:
colbarThis is a vector of colors, in any format
supported by R. These colors will be used to mark the communities on
the dendrogram, ifmark.groupsare given.colThe colors of the vertex labels, by default the
community membership is color-coded here, using the colors from thecolbarargument.mark.groupsA list of groups to mark on the tree. Groups
must correspond to disjunct subtrees of the dendrogram, otherwise
you might get strange results. This argument is interpreted as a
list of vertex numeric ids.edge.colorThe default branch color. This gives the color
of the dendrogram branches that are not marked according to themark.groupsargument.edge.ltyThe line types of the branches, a vector of two
line types, the first value is for branches marked viamark.groups, the second value is for unmarked branches. See
the documentation ofltyat the manual page ofparfor
possible values. By default unmarked branches use dashed, marked
branches use solid lines....Additional arguments to pass toplot.phylo. The syntax for plot.hclust (mode="hclust"): dendPlot(communities, mode = "hclust", rect = length(communities),
colbar = rainbow(rect), hang = -1, ann = FALSE, main = "",
sub = "", xlab = "", ylab = "", \dots, use.modularity = FALSE) The extra arguments not documented above:
rectA numeric constant, the number of groups to mark on
the dendrogram. The dendrogram is cut into exactlyrectgroups and they are marked via therect.hclustcommand. Set
this to zero if you don't want to mark any groups.colbarThe colors of the rectanges that mark the
communities via therectargument.hangWhere to put the leaf nodes, this corresponds to thehangargument ofplot.hclust.annWhether to annotate the plot, theannargument
ofplot.hclust.mainThe main title of the plot, themainargument
ofplot.hclust.subThe sub-title of the plot, thesubargument
ofplot.hclust.xlabThe label on the horizontal axis, passed toplot.hclust.ylabThe label on the vertical axis, passed toplot.hclust.dotsAttitional arguments to pass toplot.hclust. The syntax for plot.dendrogram (mode="dendrogram"): dendPlot(communities, mode="dendrogram", hang = -1, \dots,
use.modularity = FALSE) The extra argument not documented above:
hangWhere to place the leaf nodes on the plot, this is
passed toas.dendrogram.communities for other operations on
communities obejcts.karate <- graph.famous("Zachary")
fc <- fastgreedy.community(karate)
dendPlot(fc)Run the code above in your browser using DataLab