diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2018-03-30 22:03:53 +0100 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2018-03-30 22:03:53 +0100 |
| commit | 4df4236f22489a6eabc51deeb0c22dce8c7748a4 (patch) | |
| tree | 6ed14d831dfda45ac8ddee7df643bc2a103121f2 /R/gensvm.grid.R | |
| parent | Add check for y input (diff) | |
| download | rgensvm-4df4236f22489a6eabc51deeb0c22dce8c7748a4.tar.gz rgensvm-4df4236f22489a6eabc51deeb0c22dce8c7748a4.zip | |
Return invisibly on error
Diffstat (limited to 'R/gensvm.grid.R')
| -rw-r--r-- | R/gensvm.grid.R | 6 |
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) |
