Malvid | UI to help you build and document web components | Frontend Utils library
kandi X-RAY | Malvid Summary
kandi X-RAY | Malvid Summary
UI to help you build and document web components.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Malvid
Malvid Key Features
Malvid Examples and Code Snippets
Community Discussions
Trending Discussions on Malvid
QUESTION
I would like to colour the tip labels of a phylogenetic fan (resembling species identities) according to the outcome of an indicator species analysis. As such, I would like to colour-code based on the data column 'Indicator' (please see reproducible data below), so that 'H'=red, 'L'=green and 'O'=green ('na'=black).
I am currently using the following code:
...ANSWER
Answered 2017-Oct-22 at 13:39cols <- c("red","green","black","green")[as.numeric(LU$Indicator)]
cols <- cols[match(phyloFan$tip.label, row.names(LU))]
par(mar=c(0,0,0,0), oma=c(0,0,0,0))
plot.phylo(phyloFan,type="fan",show.tip.label=T,cex=0.9,show.node.label=F,
edge.color="black", adj=0, label.offset=0.75, lwd=2, edge.width=1,
tip.color=cols)
QUESTION
In a phylogenetic fan, I would like to colour code the tips (resembling 62 species in this example) by applying an if-statement. I am currently using the following code, in an attempt to colour all species associated with "O" darkgreen:
...ANSWER
Answered 2017-Sep-26 at 08:26Your code works correctly, but the colors are not ordered according to the order of tip labels (check phyloFan$tip.label
). Reordering the colors with the match
function will solve the color assignment.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Malvid
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page