From de17a6d755e9369a91abdb06562ee93d7b323bbd Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 4 Apr 2018 15:06:33 -0400 Subject: Adhere to generic function signatures --- R/plot.gensvm.grid.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'R/plot.gensvm.grid.R') diff --git a/R/plot.gensvm.grid.R b/R/plot.gensvm.grid.R index abb0601..6a34024 100644 --- a/R/plot.gensvm.grid.R +++ b/R/plot.gensvm.grid.R @@ -4,7 +4,7 @@ #' model in the provided GenSVMGrid object. See the documentation for #' \code{\link{plot.gensvm}} for more information. #' -#' @param grid A \code{gensvm.grid} object trained with refit=TRUE +#' @param x A \code{gensvm.grid} object trained with refit=TRUE #' @param ... further arguments are passed to the plot function #' #' @return returns the object passed as input @@ -31,12 +31,12 @@ #' grid <- gensvm.grid(x, y) #' plot(grid, x) #' -plot.gensvm.grid <- function(grid, ...) +plot.gensvm.grid <- function(x, ...) { - if (is.null(grid$best.estimator)) { + if (is.null(x$best.estimator)) { cat("Error: Can't plot, the best.estimator element is NULL\n") - return + return(invisible(NULL)) } - fit <- grid$best.estimator + fit <- x$best.estimator return(plot(fit, ...)) } -- cgit v1.2.3