Skip to content

Commit bc5422a

Browse files
authored
updates for no-suggests checks (#949)
* no suggests changes * more no-suggest changes * various no suggests updates * move to examplesIf * kernlab * skip skip skip * regen snapshots * skip skip * one more example adjustment * a few more minor changes
1 parent 51db99e commit bc5422a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+442
-140
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
#
4+
# NOTE: This workflow only directly installs "hard" dependencies, i.e. Depends,
5+
# Imports, and LinkingTo dependencies. Notably, Suggests dependencies are never
6+
# installed, with the exception of testthat, knitr, and rmarkdown. The cache is
7+
# never used to avoid accidentally restoring a cache containing a suggested
8+
# dependency.
9+
on:
10+
push:
11+
branches: [main, master]
12+
pull_request:
13+
14+
name: R-CMD-check-hard.yaml
15+
16+
permissions: read-all
17+
18+
jobs:
19+
check-no-suggests:
20+
runs-on: ${{ matrix.config.os }}
21+
22+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
config:
28+
- {os: ubuntu-latest, r: 'release'}
29+
30+
env:
31+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
32+
R_KEEP_PKG_SOURCE: yes
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- uses: r-lib/actions/setup-pandoc@v2
38+
39+
- uses: r-lib/actions/setup-r@v2
40+
with:
41+
r-version: ${{ matrix.config.r }}
42+
http-user-agent: ${{ matrix.config.http-user-agent }}
43+
use-public-rspm: true
44+
45+
- uses: r-lib/actions/setup-r-dependencies@v2
46+
with:
47+
dependencies: '"hard"'
48+
cache: false
49+
extra-packages: |
50+
any::rcmdcheck
51+
any::testthat
52+
any::knitr
53+
any::rmarkdown
54+
needs: check
55+
56+
- uses: r-lib/actions/check-r-package@v2
57+
with:
58+
upload-snapshots: true
59+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Imports:
3434
recipes (>= 1.0.4),
3535
rlang (>= 1.1.0),
3636
rsample (>= 1.2.1.9000),
37+
tailor,
3738
tibble (>= 3.1.0),
3839
tidyr (>= 1.2.0),
3940
tidyselect (>= 1.1.2),
@@ -52,7 +53,6 @@ Suggests:
5253
scales,
5354
spelling,
5455
splines2,
55-
tailor,
5656
testthat (>= 3.0.0),
5757
xgboost,
5858
xml2

R/conf_mat_resampled.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
#' @param tidy Should the results come back in a tibble (`TRUE`) or a `conf_mat`
1212
#' object like `yardstick::conf_mat()` (`FALSE`)?
1313
#' @return A tibble or `conf_mat` with the average cell count across resamples.
14-
#' @examples
14+
#' @examplesIf rlang::is_installed("modeldata")
15+
#' # example code
16+
#'
1517
#' library(parsnip)
1618
#' library(rsample)
1719
#' library(dplyr)

R/coord_obs_pred.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ CoordObsPred <-
3636
#' may show up in places such as the axes, the legend, the plot title, or the
3737
#' plot margins.
3838
#' @return A `ggproto` object.
39-
#' @examples
39+
#' @examplesIf rlang::is_installed("modeldata")
40+
#' # example code
4041
#' data(solubility_test, package = "modeldata")
4142
#'
4243
#' library(ggplot2)

R/extract.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
#' description section.
4646
#'
4747
#' @name extract-tune
48-
#' @examples
48+
#' @examplesIf rlang::is_installed("splines2")
49+
#' # example code
50+
#'
4951
#' library(recipes)
5052
#' library(rsample)
5153
#' library(parsnip)

R/fit_best.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#' a column for each tuning parameter. This tibble should have columns for each
1414
#' tuning parameter identifier (e.g. `"my_param"` if `tune("my_param")` was used).
1515
#' If `NULL`, this argument will be set to
16-
#' [`select_best(metric, eval_time)`][tune::select_best.tune_results].
17-
#' If not `NULL`, `parameters` overwrites the specification via `metric`, and
16+
#' [`select_best(metric, eval_time)`][tune::select_best.tune_results].
17+
#' If not `NULL`, `parameters` overwrites the specification via `metric`, and
1818
#' `eval_time`.
1919
#' @param verbose A logical for printing logging.
2020
#' @param add_validation_set When the resamples embedded in `x` are a split into
@@ -37,7 +37,7 @@
3737
#'
3838
#' @inheritSection last_fit See also
3939
#'
40-
#' @examplesIf tune:::should_run_examples()
40+
#' @examplesIf tune:::should_run_examples() & rlang::is_installed("modeldata")
4141
#' library(recipes)
4242
#' library(rsample)
4343
#' library(parsnip)

R/int_pctl.R

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,26 @@
4646
#' @references Davison, A., & Hinkley, D. (1997). _Bootstrap Methods and their
4747
#' Application_. Cambridge: Cambridge University Press.
4848
#' doi:10.1017/CBO9780511802843
49-
#' @examplesIf !tune:::is_cran_check() & tune:::should_run_examples("modeldata")
50-
#' data(Sacramento, package = "modeldata")
51-
#' library(rsample)
52-
#' library(parsnip)
49+
#' @examplesIf !tune:::is_cran_check()
50+
#' if (rlang::is_installed("modeldata")) {
51+
#' data(Sacramento, package = "modeldata")
52+
#' library(rsample)
53+
#' library(parsnip)
5354
#'
54-
#' set.seed(13)
55-
#' sac_rs <- vfold_cv(Sacramento)
55+
#' set.seed(13)
56+
#' sac_rs <- vfold_cv(Sacramento)
5657
#'
57-
#' lm_res <-
58-
#' linear_reg() %>%
59-
#' fit_resamples(
60-
#' log10(price) ~ beds + baths + sqft + type + latitude + longitude,
61-
#' resamples = sac_rs,
62-
#' control = control_resamples(save_pred = TRUE)
63-
#' )
58+
#' lm_res <-
59+
#' linear_reg() %>%
60+
#' fit_resamples(
61+
#' log10(price) ~ beds + baths + sqft + type + latitude + longitude,
62+
#' resamples = sac_rs,
63+
#' control = control_resamples(save_pred = TRUE)
64+
#' )
6465
#'
65-
#' set.seed(31)
66-
#' int_pctl(lm_res)
66+
#' set.seed(31)
67+
#' int_pctl(lm_res)
68+
#' }
6769
#' @export
6870
int_pctl.tune_results <- function(.data, metrics = NULL, eval_time = NULL,
6971
times = 1001, parameters = NULL,

R/last_fit.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
#' model (and recipe, if any) that used the training set. Helper functions
6060
#' for formatting tuning results like [collect_metrics()] and
6161
#' [collect_predictions()] can be used with `last_fit()` output.
62-
#' @examplesIf tune:::should_run_examples()
62+
#' @examplesIf tune:::should_run_examples() & rlang::is_installed("splines2")
6363
#' library(recipes)
6464
#' library(rsample)
6565
#' library(parsnip)

R/merge.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#'
1414
#' @return A tibble with a column `x` that has as many rows as were in `y`.
1515
#' @keywords internal
16-
#' @examplesIf tune:::should_run_examples(suggests = c("xgboost", "modeldata"))
16+
#' @examplesIf tune:::should_run_examples(suggests = c("xgboost", "modeldata", "splines2"))
1717
#' library(tibble)
1818
#' library(recipes)
1919
#' library(parsnip)

R/resample.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#' @template case-weights
2121
#' @template censored-regression
2222
#' @seealso [control_resamples()], [collect_predictions()], [collect_metrics()]
23-
#' @examplesIf tune:::should_run_examples()
23+
#' @examplesIf tune:::should_run_examples() & rlang::is_installed("splines2")
2424
#' library(recipes)
2525
#' library(rsample)
2626
#' library(parsnip)

0 commit comments

Comments
 (0)