Skip to content

Commit fa9d22e

Browse files
committed
minor change in the initial testing function
1 parent 62e8bdd commit fa9d22e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/inputs_chk.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ inputs_chk <- function(bin1, bin2, tree) {
7070
}
7171
} else if (inherits(tree, "phylo")) {
7272
# Check if species names in 'bin1' and 'tree' match
73-
if (!identical(sort(names(bin1)), sort(tree[[4]]))) {
73+
if (!identical(sort(names(bin1)), sort(tree$tip.label))) {
7474
stop("Species names in 'bin1' and 'tree' must match.")
7575
}
7676
}
@@ -86,7 +86,7 @@ inputs_chk <- function(bin1, bin2, tree) {
8686
# Check if species names in 'bin1', 'bin2', and 'tree' match
8787
if (inherits(tree, "phylo")) {
8888
if (!identical(sort(names(bin1)), sort(names(bin2))) ||
89-
!identical(sort(tree[[4]]), sort(names(bin1)))) {
89+
!identical(sort(tree$tip.label), sort(names(bin1)))) {
9090
stop("Species names in 'bin1', 'bin2', and 'tree' must
9191
match.")
9292
}

0 commit comments

Comments
 (0)