pf.plot | R Documentation |
Label and visualize phylofactors
pf.plot(PF, tree = NULL, Data = NULL, bg = "white", cex = 2,
factors = 1, compare = F, ...)
PF |
PhyloFactor object |
tree |
Phylogeny used in generating PhyloFactor object. Default will scan PF for a tree. |
Data |
Data used to generate PhyloFactor object. If Null, default will plot the phylofactor prediction of the dataset. |
bg |
Background color for node labels, default 'white' |
cex |
Size of node labels, default 2. |
factors |
factors of phylofactor object to be labelled on tree and used in prediction. |
compare |
Whether or not to compare the Data with phylofactor prediction. If compare = TRUE, two phylo-heatmaps will be produced for direct comparison. |
... |
additional arguments for pf.heatmap |
phylo.heatmap labelling the tree with phylofactors and optionally comparing data to phylofactor predictions.
### Create Data ###
set.seed(1)
tree <- unroot(rtree(7))
X <- as.factor(c(rep(0,5),rep(1,5)))
sigClades <- phangorn::Descendants(tree,c(9,12),type='tips')
Data <- matrix(rlnorm(70,meanlog = 8,sdlog = .5),nrow=7)
rownames(Data) <- tree$tip.label
colnames(Data) <- X
Data[sigClades[[1]],X==0] <- Data[sigClades[[1]],X==0]*8
Data[sigClades[[2]],X==1] <- Data[sigClades[[2]],X==1]*9
Data <- t(clo(t(Data)))
PF <- PhyloFactor(Data,tree,X,nfactors=2)
pf.plot(PF,factors=1)
pf.plot(PF,factors=c(1,2),Data=PF$Data,compare=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.