eastman / spacodir Goto Github PK
View Code? Open in Web Editor NEWcommunity phylogenetics in R
community phylogenetics in R
Hello,
First thank you for your great package spacodiR
.
I found a really small issue in your resamp.phy
function:
I'm currently working with a tree I want to randomized that have named nodes. And if I want to launch the function resamp.phy
on it I get the following error:
Error in if (node <= n) return(NULL) :
missing value where TRUE/FALSE needed
So a really simple fix is only to delete the node names with : tree$node.label <- NULL
. But you'll agree for saying it's not really elegant ? So I wanted to correct myself the issue and suggest you a fix. I found the problem came from this line in resamp.phy
function: tt = as.numeric(names(tt)[which(tt)])
. It works well when you don't have node names because automatically this line tt = sapply(b, function(x) withinrange(x, 0, time.threshold))
will give numbers as node names. But if you do have node names the as.numeric
function on a character vector will produce NA
bringing the function to bug. As a conclusion I wasn't able to suggest you a fix because I don't really now if you can manage node labels with get.descendants.of.node
function our if you can only accept numerical names for tree nodes.
Please find bellow an example of code triggering the bug:
library(spacodiR)
data(sp.example)
attach(sp.example)
phy$node.label <- c(letters)[1:length(branching.times(phy))] # Giving letter name to nodes
resamp.phy(phy)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.