I am doing some bibliometric analysis of interdisciplinarity using
cluster analysis of co-authorship.
I'd like to be able to specify the colour of individual authors in the
labels to show a prior grouping by discipline (red for sociology
authors, blue for economics authors, ..., that sort of thing).
Is there any way of doing this sort of thing? I'm hoping for something like:
h <- hclust(authors.dist)
h$labels <- colorlabels(c("red", "blue",..., "green"))
plot(h)
change individual label colours in a cluster plot?
3 messages · Jim Ottaway, patricia garcía gonzález
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090205/ac53600a/attachment-0001.pl>
patricia garc?a gonz?lez <kurtney_84 at hotmail.com> writes:
Hi,
If you have a variable, that defines what you want to differentiate (sociology, economics etc.) then you can add color depending on the value of that variable. You will have to convert it to numeric if it is not. An example would be
plot( iris[ , 1 ], iris[ , 2], col = iris[ , 3 ] )
Thank you. I'm not sure that I can do that with an hclust object, though: perhaps something using the text function and the order data in the hclust object might work? Currently, I'm good getting results using a script to edit the postscript output, but I'm keen to find an R solution, if only to improve my understanding of R graphicss. Yours sincerely,
Jim Ottaway