From 097545aa061c5693bb2bbf07dbc0ef165293cc89 Mon Sep 17 00:00:00 2001 From: Gavin Rhys Lloyd Date: Wed, 11 Dec 2019 14:16:27 +0000 Subject: [PATCH] default to zero if polyroot fails to return any roots --- R/PLSDA_class.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/PLSDA_class.R b/R/PLSDA_class.R index 6044412..425e784 100644 --- a/R/PLSDA_class.R +++ b/R/PLSDA_class.R @@ -148,7 +148,7 @@ 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 ) {