From 937772ceb77f3213119d736da8e2fad620d16add Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Fri, 30 Mar 2018 17:08:49 +0100 Subject: Update some return values --- R/predict.gensvm.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'R/predict.gensvm.R') diff --git a/R/predict.gensvm.R b/R/predict.gensvm.R index d7540f6..133b40e 100644 --- a/R/predict.gensvm.R +++ b/R/predict.gensvm.R @@ -54,7 +54,7 @@ predict.gensvm <- function(fit, x.test, ...) if (ncol(x.test) != fit$n.features) { cat("Error: Number of features of fitted model and testing", "data disagree.\n") - return + return(NULL) } x.train <- fit$X.train @@ -62,11 +62,12 @@ predict.gensvm <- function(fit, x.test, ...) cat("Error: The training data is needed to compute predictions for ", "nonlinear GenSVM. This data is not present in the fitted ", "model!\n", sep="") + return(NULL) } if (!is.null(x.train) && ncol(x.train) != fit$n.features) { cat("Error: Number of features of fitted model and training", "data disagree.\n") - return + return(NULL) } if (fit$kernel == 'linear') { -- cgit v1.2.3