Unverified Commit c454d5f8 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[R-package] move all examples to dontrun() to fix R CMD CHECK notes (#3270)



* Move all examples to dontrun

* update docs

* fix nested dontrun

* remove :: in examples

* run_dontrun in pkgdown
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>
parent 6f54ec3d
......@@ -18,7 +18,7 @@ readRDS.lgb.Booster(file = "", refhook = NULL)
Attempts to load a model stored in a \code{.rds} file, using \code{\link[base]{readRDS}}
}
\examples{
\donttest{
\dontrun{
library(lightgbm)
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
......
......@@ -42,7 +42,7 @@ Attempts to save a model using RDS. Has an additional parameter (\code{raw})
which decides whether to save the raw model or not.
}
\examples{
\donttest{
\dontrun{
library(lightgbm)
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
......
......@@ -38,6 +38,7 @@ The \code{name} field can be one of the following:
}
}
\examples{
\dontrun{
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label = train$label)
......@@ -48,5 +49,5 @@ lightgbm::setinfo(dtrain, "label", 1 - labels)
labels2 <- lightgbm::getinfo(dtrain, "label")
stopifnot(all.equal(labels2, 1 - labels))
}
}
......@@ -24,6 +24,7 @@ Get a new \code{lgb.Dataset} containing the specified rows of
original \code{lgb.Dataset} object
}
\examples{
\dontrun{
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label = train$label)
......@@ -31,5 +32,5 @@ dtrain <- lgb.Dataset(train$data, label = train$label)
dsub <- lightgbm::slice(dtrain, seq_len(42L))
lgb.Dataset.construct(dsub)
labels <- lightgbm::getinfo(dsub, "label")
}
}
......@@ -247,7 +247,7 @@ def generate_r_docs(app):
, install = FALSE \
, devel = FALSE \
, examples = TRUE \
, run_dont_run = FALSE \
, run_dont_run = TRUE \
, seed = 42L \
, preview = FALSE \
, new_process = TRUE \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment