[R] Split PVClust plot

Tal Galili tal.galili at gmail.com
Sun Aug 31 06:03:16 CEST 2014


Hi Tom,

There is a "as.dendrogram.pvclust" function in the package dendextend.
(it is on CRAN: http://cran.r-project.org/web/packages/dendextend/)

You can run:

install.packages('dendextend')
library(dendextend)
result2  <- as.dendrogram(result)
# You can then also use the "prune" function in dendextend, to get the
subtree you are interested in.

Also, there is an example of pvclust in the package vignette (just
search pvclust
here):
http://cran.r-project.org/web/packages/dendextend/vignettes/introduction.html
The example shows how to highlight significant branches (with line width
and color).

With regards,
Tal






----------------Contact
Details:-------------------------------------------------------
Contact me: Tal.Galili at gmail.com |
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------



On Tue, Jul 29, 2014 at 12:40 AM, Worthington, Thomas A <
thomas.worthington at okstate.edu> wrote:

> Dear All
>
> I'm using PVClust to perform hierarchical clustering, for the output plot
> I can control most of the graphical I need, however the plot is large and I
> would like to split it vertically into two panels one above the other. Is
> there a way to plot only part of a PVClust plot, I tried to convert it to a
> dendrogram with
>
> result2  = as.dendrogram(result)
>
> however I get the error message "no applicable method for 'as.dendrogram'
> applied to an object of class "pvclust". I also wondered whether it would
> be possible to convert to a phylogenetic tree and use the functions in the
> 'ape' package?
>
> Any suggestion on how to split up a PVclust plot would be greatly
> appreciated  (code for the plot below)
>
> Thanks
> Tom
>
>
> result <- pvclust(df.1, method.dist="uncentered",
> method.hclust="average",nboot=10)
> par(mar=c(0,0,0,0))
> par(oma=c(0,0,0,0))
> plot(result, print.pv =FALSE, col.pv=c("red","",""), print.num=FALSE,
> float = 0.02, font=1,
>         axes=T, cex =0.85, main="", sub="", xlab="", ylab= "",
> labels=NULL, hang=-1)
> pvrect(result, alpha=0.95)
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list