Skip to content

Commit

Permalink
default to zero if polyroot fails to return any roots
Browse files Browse the repository at this point in the history
default threshold is 0 because groups are +/- 1
  • Loading branch information
grlloyd committed Dec 11, 2019
1 parent 1cf78d0 commit babc96e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/PLSDA_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ prob=function(x,yhat,ytrue)

if (length(t)>1) {
# multiple cross over points so choose the one closest to 0
t=t[which.min(abs(t))]
t=t[which.min(abs(t),)]
}

if (length(t)==0 ) {
# length is zero. how does this happen? default to 0.
t=0
}

if (is.na(t)) {
Expand Down

0 comments on commit babc96e

Please sign in to comment.