Skip to content

Commit

Permalink
Fixed corner case in get.tree with age = 0
Browse files Browse the repository at this point in the history
  • Loading branch information
TGuillerme committed Feb 28, 2024
1 parent 80f301d commit 7d83950
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Authors@R: c(person("Thomas", "Guillerme", role = c("aut", "cre", "cph"),
person("Jack", "Hatfield", role = c("aut", "cph"))
)
Maintainer: Thomas Guillerme <guillert@tcd.ie>
Version: 1.8.6
Date: 2024-02-27
Version: 1.8.7
Date: 2024-02-28
Description: A modular package for measuring disparity (multidimensional space occupancy). Disparity can be calculated from any matrix defining a multidimensional space. The package provides a set of implemented metrics to measure properties of the space and allows users to provide and test their own metrics. The package also provides functions for looking at disparity in a serial way (e.g. disparity through time) or per groups as well as visualising the results. Finally, this package provides several statistical tests for disparity analysis.
Depends:
R (>= 3.6.0),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dispRity v1.8.6 (2024-02-27)
dispRity v1.8.7 (2024-02-28)
=========================

### NEW FEATURES
Expand Down
7 changes: 6 additions & 1 deletion R/dispRity.utilities_fun.R
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,12 @@ slide.node.root <- function(bin_age, tree) {
get.interval.subtrees <- function(one_tree, bin_ages, to.root) {
## Slice the right sides of the trees
slice.one.tree <- function(age, tree) {
slice.tree(tree, age[2], model = "acctran", keep.all.ancestors = TRUE)
if(age[2] != 0) {
slice.tree(tree, age[2], model = "acctran", keep.all.ancestors = TRUE)
} else {
## If age = 0, simply return the tree (keep everything and then compress branch lengths)
return(tree)
}
}
subset_subtrees <- lapply(bin_ages, slice.one.tree, one_tree) # TODO need fix for multiphylo

Expand Down

0 comments on commit 7d83950

Please sign in to comment.