aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2018-03-30 22:01:52 +0100
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2018-03-30 22:01:52 +0100
commita15c5d21b993e47b7545e16ddf1228ad6e6a38fc (patch)
tree6b98384e92bbac9626be64c0f605933e4ea22a2a
parentUpdate docs and remove xtrain from output list (diff)
downloadrgensvm-a15c5d21b993e47b7545e16ddf1228ad6e6a38fc.tar.gz
rgensvm-a15c5d21b993e47b7545e16ddf1228ad6e6a38fc.zip
Add check for y input
-rw-r--r--R/gensvm.R5
1 files changed, 5 insertions, 0 deletions
diff --git a/R/gensvm.R b/R/gensvm.R
index 0464322..425bf9b 100644
--- a/R/gensvm.R
+++ b/R/gensvm.R
@@ -116,6 +116,11 @@ gensvm <- function(X, y, p=1.0, lambda=1e-8, kappa=0.0, epsilon=1e-6,
{
call <- match.call()
+ if (dim(as.matrix(y))[2] > 1) {
+ cat("Error: y can not have more than one column\n")
+ return(invisible(NULL))
+ }
+
# Generate the random.seed value in R if it is NULL. This way users can
# reproduce the run because it is returned in the output object.
if (is.null(random.seed))