aboutsummaryrefslogtreecommitdiff
path: root/R/gensvm.grid.R
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2018-03-30 22:03:53 +0100
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2018-03-30 22:03:53 +0100
commit4df4236f22489a6eabc51deeb0c22dce8c7748a4 (patch)
tree6ed14d831dfda45ac8ddee7df643bc2a103121f2 /R/gensvm.grid.R
parentAdd check for y input (diff)
downloadrgensvm-4df4236f22489a6eabc51deeb0c22dce8c7748a4.tar.gz
rgensvm-4df4236f22489a6eabc51deeb0c22dce8c7748a4.zip
Return invisibly on error
Diffstat (limited to 'R/gensvm.grid.R')
-rw-r--r--R/gensvm.grid.R6
1 files changed, 3 insertions, 3 deletions
diff --git a/R/gensvm.grid.R b/R/gensvm.grid.R
index 8f875a3..c541ea0 100644
--- a/R/gensvm.grid.R
+++ b/R/gensvm.grid.R
@@ -157,8 +157,8 @@ gensvm.grid <- function(X, y, param.grid='tiny', refit=TRUE, scoring=NULL, cv=3,
n.classes <- length(unique(y))
if (n.objects != length(y)) {
- cat("Error: X and y are not the same length.\n")
- invisible(NULL)
+ cat("Error: x and y are not the same length.\n")
+ return(invisible(NULL))
}
if (is.character(param.grid)) {
@@ -173,7 +173,7 @@ gensvm.grid <- function(X, y, param.grid='tiny', refit=TRUE, scoring=NULL, cv=3,
# Validate the range of the values for the gridsearch
if (!gensvm.validate.param.grid(param.grid))
- invisible(NULL)
+ return(invisible(NULL))
# Sort the parameter grid for efficient warm starts
param.grid <- gensvm.sort.param.grid(param.grid)