-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rtt function no longer handles NAs in dates #73
Comments
Would a line like this: if (anyNA(tip.dates)) stop("missing values not allowed in 'tip.dates'") at the start of |
Could you add the ability to censor tip dates with NAs back? I need this functionality for some of the software that I maintain. |
You mean change nothing with respect to the current version? |
The problem is an update in R. Consider the following code: library(ape)
set.seed(0)
tree <- rtree(5)
dates <- c(1, 2, 3, NA, NA)
rtt(tree, dates) In R version 4.2.2 it gives an error:
In R version 4.0.5 it roots the tree. The issue is that the The fix is fairly simple. Just change line 31 of rtt.R to: cor(y, x, use = "complete.obs") |
Fixed and pushed. |
The
rrt
function performs root-to-tip regression on trees. In previous versions, you could putNA
in thedates
parameter to censor tips from the regression. However, this does not seem to be possible anymore. I can make a PR to fix this, if you want.The text was updated successfully, but these errors were encountered: