Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

iclust.diagram

Draw an ICLUST hierarchical cluster structure diagram


Description

Given a cluster structure determined by ICLUST, create a graphic structural diagram using graphic functions in the psych package To create dot code to describe the ICLUST output with more precision, use ICLUST.graph. If Rgraphviz has been successfully installed, the alternative is to use ICLUST.rgraph.

Usage

iclust.diagram(ic, labels = NULL, short = FALSE, digits = 2, cex = NULL, min.size = NULL,
     e.size =1,colors=c("black","blue"), 
     main = "ICLUST diagram",cluster.names=NULL,marg=c(.5,.5,1.5,.5))

Arguments

ic

Output from ICLUST

labels

labels for variables (if not specified as rownames in the ICLUST output

short

if short=TRUE, variable names are replaced with Vn

digits

Round the path coefficients to digits accuracy

cex

The standard graphic control parameter for font size modifications. This can be used to make the labels bigger or smaller than the default values.

min.size

Don't provide statistics for clusters less than min.size

e.size

size of the ellipses with the cluster statistics.

colors

postive and negative

main

The main graphic title

cluster.names

Normally, clusters are named sequentially C1 ... Cn. If cluster.names are specified, then these values will be used instead.

marg

Sets the margins to be narrower than the default values. Resets them upon return

Details

iclust.diagram provides most of the power of ICLUST.rgraph without the difficulties involved in installing Rgraphviz. It is called automatically from ICLUST.

Following a request by Michael Kubovy, cluster.names may be specified to replace the normal C1 ... Cn names.

If access to a dot language graphics program is available, it is probably better to use the iclust.graph function to get dot output for offline editing.

Value

Graphical output summarizing the hierarchical cluster structure. The graph is drawn using the diagram functions (e.g., dia.curve, dia.arrow, dia.rect, dia.ellipse ) created as a work around to Rgraphviz.

Note

Suggestions for improving the graphic output are welcome.

Author(s)

William Revelle

References

Revelle, W. Hierarchical Cluster Analysis and the Internal Structure of Tests. Multivariate Behavioral Research, 1979, 14, 57-74.

See Also

Examples

v9 <- sim.hierarchical()
v9c <- ICLUST(v9)
test.data <- Harman74.cor$cov
ic.out <- ICLUST(test.data)
#now show how to relabel clusters
ic.bfi <- iclust(psychTools::bfi[1:25],beta=3) #find the clusters
cluster.names <- rownames(ic.bfi$results) #get the old names
#change the names to the desired ones
cluster.names[c(16,19,18,15,20)] <- c("Neuroticism","Extra-Open","Agreeableness",
      "Conscientiousness","Open")
#now show the new names
iclust.diagram(ic.bfi,cluster.names=cluster.names,min.size=4,e.size=1.75)

psych

Procedures for Psychological, Psychometric, and Personality Research

v2.1.3
GPL (>= 2)
Authors
William Revelle [aut, cre] (<https://orcid.org/0000-0003-4880-9610>)
Initial release
2021-03-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.