diff --git a/R/PLSDA_class.R b/R/PLSDA_class.R index 5f4caf1..6044412 100644 --- a/R/PLSDA_class.R +++ b/R/PLSDA_class.R @@ -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)) {