Skip to content

Commit

Permalink
Fix check
Browse files Browse the repository at this point in the history
Resolves #25 : an issue with triggering the error, not calculating the steps
  • Loading branch information
ms609 committed Feb 13, 2018
1 parent 29f3cc5 commit 88dd16d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/IWScore.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ IWScore <- function (tree, dataset, concavity=4) {
homoplasies <- steps - minSteps

# TODO remove this paranoid check once 100% happy with minSteps calculation.
if (homoplasies < 0) stop("Minimum steps have been miscalculated.
Please report this bug at
https://github.com/ms609/TreeSearch/issues/new")
if (any(homoplasies < 0)) stop("Minimum steps have been miscalculated.\n",
" Please report this bug at:\n",
" https://github.com/ms609/TreeSearch/issues/new")
fit <- homoplasies / (homoplasies + concavity)
# Return:
sum(fit * weight)
Expand Down

0 comments on commit 88dd16d

Please sign in to comment.