From 66257a30967829e984c4c5b6a50f31976496e085 Mon Sep 17 00:00:00 2001 From: schalkdaniel Date: Wed, 29 Mar 2023 16:42:04 +0200 Subject: [PATCH] add donttest to avoid NOTE trigger from CRAN --- R/plot_tensor.R | 10 ++++++---- man/plotTensor.Rd | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/R/plot_tensor.R b/R/plot_tensor.R index f2a61214..4c2bea5c 100644 --- a/R/plot_tensor.R +++ b/R/plot_tensor.R @@ -18,16 +18,18 @@ #' Number of bins for the surface. Only applies in the case of two numerical features. #' A smooth surface is drawn if `nbins = NULL`. #' @examples +#' \donttest{ #' cboost = Compboost$new(data = iris, target = "Petal.Length", #' learning_rate = 0.1) #' -#' cboost$addTensor("Sepal.Width", "Sepal.Length", df1 = 4, df2 = 4, n_knots = 7) -#' cboost$addTensor("Sepal.Width", "Species", df1 = 4, df2 = 2, n_knots = 7) +#' cboost$addTensor("Sepal.Width", "Sepal.Length", df1 = 4, df2 = 4, n_knots = 10) +#' cboost$addTensor("Sepal.Width", "Species", df1 = 4, df2 = 2, n_knots = 10) #' #' cboost$train(100L) #' -#' plotTensor(cboost, "Sepal.Width_Species_tensor", npoints = 10L) -#' plotTensor(cboost, "Sepal.Width_Sepal.Length_tensor", npoints = 10L) +#' plotTensor(cboost, "Sepal.Width_Species_tensor") +#' plotTensor(cboost, "Sepal.Width_Sepal.Length_tensor") +#' } #' @export plotTensor = function(cboost, tname, npoints = 100L, nbins = 15L) { if (! requireNamespace("ggplot2", quietly = TRUE)) stop("Please install ggplot2 to create plots.") diff --git a/man/plotTensor.Rd b/man/plotTensor.Rd index 98eab638..f6be6c6a 100644 --- a/man/plotTensor.Rd +++ b/man/plotTensor.Rd @@ -31,14 +31,16 @@ A smooth surface is drawn if \code{nbins = NULL}.} This function visualizes the contribution of a bivariate tensor product. } \examples{ +\donttest{ cboost = Compboost$new(data = iris, target = "Petal.Length", learning_rate = 0.1) -cboost$addTensor("Sepal.Width", "Sepal.Length", df1 = 4, df2 = 4, n_knots = 7) -cboost$addTensor("Sepal.Width", "Species", df1 = 4, df2 = 2, n_knots = 7) +cboost$addTensor("Sepal.Width", "Sepal.Length", df1 = 4, df2 = 4, n_knots = 10) +cboost$addTensor("Sepal.Width", "Species", df1 = 4, df2 = 2, n_knots = 10) cboost$train(100L) -plotTensor(cboost, "Sepal.Width_Species_tensor", npoints = 10L) -plotTensor(cboost, "Sepal.Width_Sepal.Length_tensor", npoints = 10L) +plotTensor(cboost, "Sepal.Width_Species_tensor") +plotTensor(cboost, "Sepal.Width_Sepal.Length_tensor") +} }