diff --git a/NEWS.md b/NEWS.md index 7e0fbd71..c186e205 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,10 +8,14 @@ * `map_chr()` no longer coereces from logical, integer, or double to strings. +* `every()`, `some()`, and `none()` now require that `.p` return logical scalar `TRUE`, `FALSE`, or `NA`. Previously, `NA` was allowed to be a non-logical `NA`, and would be coerced to a logical `NA`. + ## Minor improvements and bug fixes * New "getting started" vignette, `vignette("purrr")` (#915, @ogolovkina). +* `every()`, `some()`, and `none()` are now more performant. They are now as fast as or faster than their equivalent `any(map_lgl())` or `all(map_lgl())` calls (#1036, @ErdaradunGaztea). + * `as_mapper.default()` optimized by removing special named argument handling for primitive functions (@mtcarsalot, #1088). * `list_flatten()` gains an `is_node` parameter taking a predicate function that determines whether an input element is a node or a leaf (@salim-b, #1179). diff --git a/R/every-some-none.R b/R/every-some-none.R index 8a5a4eee..e37b2afc 100644 --- a/R/every-some-none.R +++ b/R/every-some-none.R @@ -22,39 +22,48 @@ #' # unsafe (e.g. in `if ()` conditions), make sure to use safe predicates: #' if (some(list(NA, FALSE), rlang::is_true)) "foo" else "bar" every <- function(.x, .p, ...) { - .p <- as_predicate(.p, ..., .mapper = TRUE, .allow_na = TRUE) - - val <- TRUE - for (i in seq_along(.x)) { - val <- val && .p(.x[[i]], ...) - - if (is_false(val)) { - return(FALSE) - } - } - - val + satisfies_predicate(.x, .p, ..., .purrr_predicate = "every") } #' @export #' @rdname every some <- function(.x, .p, ...) { - .p <- as_predicate(.p, ..., .mapper = TRUE, .allow_na = TRUE) - - val <- FALSE - for (i in seq_along(.x)) { - val <- val || .p(.x[[i]], ...) - - if (is_true(val)) { - return(TRUE) - } - } - - val + satisfies_predicate(.x, .p, ..., .purrr_predicate = "some") } #' @export #' @rdname every none <- function(.x, .p, ...) { - every(.x, negate(.p), ...) + satisfies_predicate(.x, .p, ..., .purrr_predicate = "none") +} + +satisfies_predicate <- function( + .x, + .p, + ..., + .purrr_predicate, + .purrr_user_env = caller_env(2), + .purrr_error_call = caller_env() +) { + # Not using `as_predicate()` as R level predicate result checks are too slow. + # Checks are done at the C level instead (#1169). Also, `NA` propagates + # through these functions, which `as_predicate()` doesn't allow. + .p <- as_mapper(.p, ...) + + # Consistent with `map()` + .x <- vctrs_vec_compat(.x, .purrr_user_env) + obj_check_vector(.x, arg = ".x", call = .purrr_error_call) + + n <- vec_size(.x) + + i <- 0L + + # We refer to `.p`, `.x`, `i`, `...`, and `.purrr_error_call` all from C level + switch( + .purrr_predicate, + every = .Call(every_impl, environment(), n, i), + some = .Call(some_impl, environment(), n, i), + none = .Call(none_impl, environment(), n, i), + abort("Unreachable", .internal = TRUE) + ) } diff --git a/R/utils.R b/R/utils.R index 614b5ef3..90455675 100644 --- a/R/utils.R +++ b/R/utils.R @@ -60,7 +60,6 @@ as_predicate <- function( .fn, ..., .mapper, - .allow_na = FALSE, .purrr_error_call = caller_env(), .purrr_error_arg = caller_arg(.fn) ) { @@ -75,10 +74,6 @@ as_predicate <- function( out <- .fn(...) if (!is_bool(out)) { - if (is_na(out) && .allow_na) { - # Always return a logical NA - return(NA) - } cli::cli_abort( "{.fn { .purrr_error_arg }} must return a single `TRUE` or `FALSE`, not {.obj_type_friendly {out}}.", arg = .purrr_error_arg, @@ -115,8 +110,9 @@ vctrs_list_compat <- function( } # When we want to use vctrs, but treat lists like purrr does -# Treat data frames and S3 scalar lists like bare lists. -# But ensure rcrd vctrs retain their class. +# +# Treats data frames and S3 scalar lists like bare lists. +# But ensures rcrd vctrs retain their class. vctrs_vec_compat <- function(x, user_env) { if (inherits(x, "by")) { class(x) <- NULL @@ -127,7 +123,7 @@ vctrs_vec_compat <- function(x, user_env) { } else if (is.pairlist(x)) { lifecycle::deprecate_soft( when = "1.0.0", - what = I("Use of pairlists in map functions"), + what = I("Use of pairlists in purrr functions"), details = "Please coerce explicitly with `as.list()`", user_env = user_env ) @@ -138,7 +134,7 @@ vctrs_vec_compat <- function(x, user_env) { } else if (is_call(x) || is.expression(x)) { lifecycle::deprecate_soft( when = "1.0.0", - what = I("Use of calls and pairlists in map functions"), + what = I("Use of calls and expressions in purrr functions"), details = "Please coerce explicitly with `as.list()`", user_env = user_env ) diff --git a/revdep/README.md b/revdep/README.md index 2438c849..c00f964c 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -1,6 +1,6 @@ # Revdeps -## Failed to check (24) +## Failed to check (31) |package |version |error |warning |note | |:----------------|:-------|:------|:-------|:----| @@ -8,8 +8,17 @@ |arealDB |0.9.4 |1 | | | |ClusterGVis |? | | | | |dsTidyverse |? | | | | +|eye |? | | | | |ggmosaic |0.3.3 |1 | | | +|heplots |? | | | | +|hmde |? | | | | +|httk |? | | | | |immcp |? | | | | +|imt |? | | | | +|intervalpsych |? | | | | +|irtQ |? | | | | +|isotracer |? | | | | +|jpcity |? | | | | |[kerastuneR](failures.md#kerastuner)|0.1.0.7 |__+1__ | | | |lcsm |? | | | | |metajam |0.3.1 |1 | | | @@ -18,28 +27,25 @@ |numbat |? | | | | |ontologics |0.7.4 |1 | | | |rdflib |0.2.9 |1 | | | +|rmweather |? | | | | +|rstanemax |? | | | | |RVA |? | | | | +|sampler |? | | | | +|sbm |? | | | | |SCpubr |? | | | | -|sprtt |? | | | | -|ssdGSA |? | | | | -|[stoRy](failures.md#story)|0.2.2 |__+1__ | | | |Surrogate |? | | | | -|tidybins |? | | | | -|tidycomm |? | | | | -|[tidyjson](failures.md#tidyjson)|0.3.2 |__+1__ | |-1 | |TriDimRegression |1.0.2 |1 | | | -## New problems (9) +## New problems (8) -|package |version |error |warning |note | -|:--------------|:-------|:--------|:-------|:----| -|[autothresholdr](problems.md#autothresholdr)|1.4.2 |__+1__ | |1 | -|[casino](problems.md#casino)|0.1.0 |__+1__ | |2 | -|[CPAT](problems.md#cpat)|0.1.0 |__+1__ | |1 | -|[egor](problems.md#egor)|1.24.2 |__+2__ | | | -|[immunarch](problems.md#immunarch)|0.9.1 |__+1__ | |1 | -|[moranajp](problems.md#moranajp)|0.9.7 |__+1__ | | | -|[quincunx](problems.md#quincunx)|0.1.10 |__+2__ | | | -|[SCORPIUS](problems.md#scorpius)|1.0.9 | |__+1__ |1 | -|[tfrmt](problems.md#tfrmt)|0.2.0 |1 __+1__ | | | +|package |version |error |warning |note | +|:---------|:-------|:------|:-------|:--------| +|[casino](problems.md#casino)|0.1.0 |__+1__ | |2 | +|[CPAT](problems.md#cpat)|0.1.0 |__+1__ | |1 | +|[egor](problems.md#egor)|1.24.2 |__+2__ | | | +|[immunarch](problems.md#immunarch)|0.9.1 |__+1__ | |1 | +|[meta](problems.md#meta)|8.2-1 | | |1 __+1__ | +|[moranajp](problems.md#moranajp)|0.9.7 |__+1__ | | | +|[quincunx](problems.md#quincunx)|0.1.10 |__+2__ | | | +|[SCORPIUS](problems.md#scorpius)|1.0.9 | |__+1__ |1 | diff --git a/revdep/cran.md b/revdep/cran.md index d0c34044..2a07c729 100644 --- a/revdep/cran.md +++ b/revdep/cran.md @@ -1,18 +1,15 @@ ## revdepcheck results -We checked 2125 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. +We checked 1702 reverse dependencies (1701 from CRAN + 1 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package. - * We saw 9 new problems - * We failed to check 24 packages + * We saw 8 new problems + * We failed to check 30 packages Issues with CRAN packages are summarised below. ### New problems (This reports the first line of each new failure) -* autothresholdr - checking re-building of vignette outputs ... ERROR - * casino checking re-building of vignette outputs ... ERROR @@ -26,6 +23,9 @@ Issues with CRAN packages are summarised below. * immunarch checking examples ... ERROR +* meta + checking installed package size ... NOTE + * moranajp checking examples ... ERROR @@ -36,9 +36,6 @@ Issues with CRAN packages are summarised below. * SCORPIUS checking whether package ‘SCORPIUS’ can be installed ... WARNING -* tfrmt - checking examples ... ERROR - ### Failed to check * apa (NA) @@ -46,7 +43,15 @@ Issues with CRAN packages are summarised below. * ClusterGVis (NA) * dsTidyverse (NA) * ggmosaic (NA) +* heplots (NA) +* hmde (NA) +* httk (NA) * immcp (NA) +* imt (NA) +* intervalpsych (NA) +* irtQ (NA) +* isotracer (NA) +* jpcity (NA) * kerastuneR (NA) * lcsm (NA) * metajam (NA) @@ -55,13 +60,11 @@ Issues with CRAN packages are summarised below. * numbat (NA) * ontologics (NA) * rdflib (NA) +* rmweather (NA) +* rstanemax (NA) * RVA (NA) +* sampler (NA) +* sbm (NA) * SCpubr (NA) -* sprtt (NA) -* ssdGSA (NA) -* stoRy (NA) * Surrogate (NA) -* tidybins (NA) -* tidycomm (NA) -* tidyjson (NA) * TriDimRegression (NA) diff --git a/revdep/failures.md b/revdep/failures.md index bab8833e..a76d37f2 100644 --- a/revdep/failures.md +++ b/revdep/failures.md @@ -291,6 +291,41 @@ Status: 1 NOTE +``` +# eye + +
+ +* Version: NA +* GitHub: NA +* Source code: https://github.com/cran/eye +* Number of recursive dependencies: 58 + +Run `revdepcheck::cloud_details(, "eye")` for more info + +
+ +## Error before installation + +### Devel + +``` + + + + + + +``` +### CRAN + +``` + + + + + + ``` # ggmosaic @@ -355,6 +390,174 @@ ERROR: lazy loading failed for package ‘ggmosaic’ * removing ‘/tmp/workdir/ggmosaic/old/ggmosaic.Rcheck/ggmosaic’ +``` +# heplots + +
+ +* Version: 1.7.8 +* GitHub: https://github.com/friendly/heplots +* Source code: https://github.com/cran/heplots +* Date/Publication: 2025-08-18 23:50:36 UTC +* Number of recursive dependencies: 144 + +Run `revdepcheck::cloud_details(, "heplots")` for more info + +
+ +## Error before installation + +### Devel + +``` + + + + + + +``` +### CRAN + +``` +* using log directory ‘/tmp/workdir/heplots/old/heplots.Rcheck’ +* using R version 4.4.0 (2024-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 + GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 +* running under: Ubuntu 24.04.2 LTS +* using session charset: UTF-8 +* using option ‘--no-manual’ +* checking for file ‘heplots/DESCRIPTION’ ... OK +... +* checking data for ASCII and uncompressed saves ... OK +* checking sizes of PDF files under ‘inst/doc’ ... OK +* checking installed files from ‘inst/doc’ ... OK +* checking files in ‘vignettes’ ... OK +* checking examples ... OK +* checking for unstated dependencies in vignettes ... OK +* checking package vignettes ... OK +* checking re-building of vignette outputs ... OK +* DONE +Status: OK + + + + + +``` +# hmde + +
+ +* Version: 1.2.1 +* GitHub: https://github.com/traitecoevo/hmde +* Source code: https://github.com/cran/hmde +* Date/Publication: 2025-07-04 19:20:06 UTC +* Number of recursive dependencies: 107 + +Run `revdepcheck::cloud_details(, "hmde")` for more info + +
+ +## Error before installation + +### Devel + +``` + + + + + + +``` +### CRAN + +``` +* using log directory ‘/tmp/workdir/hmde/old/hmde.Rcheck’ +* using R version 4.4.0 (2024-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 + GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 +* running under: Ubuntu 24.04.2 LTS +* using session charset: UTF-8 +* using option ‘--no-manual’ +* checking for file ‘hmde/DESCRIPTION’ ... OK +... + `plot` has type 'object', not 'list'. + + [ FAIL 4 | WARN 0 | SKIP 0 | PASS 85 ] + Error: Test failures + Execution halted +* checking for unstated dependencies in vignettes ... OK +* checking package vignettes ... OK +* checking re-building of vignette outputs ... OK +* DONE +Status: 1 ERROR, 2 NOTEs + + + + + +``` +# httk + +
+ +* Version: 2.7.3 +* GitHub: https://github.com/USEPA/CompTox-ExpoCast-httk +* Source code: https://github.com/cran/httk +* Date/Publication: 2025-09-12 15:00:02 UTC +* Number of recursive dependencies: 173 + +Run `revdepcheck::cloud_details(, "httk")` for more info + +
+ +## Error before installation + +### Devel + +``` + + + + + + +``` +### CRAN + +``` +* using log directory ‘/tmp/workdir/httk/old/httk.Rcheck’ +* using R version 4.4.0 (2024-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 + GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 +* running under: Ubuntu 24.04.2 LTS +* using session charset: UTF-8 +* using option ‘--no-manual’ +* checking for file ‘httk/DESCRIPTION’ ... OK +... + Running ‘solve_gas_test.R’ + Comparing ‘solve_gas_test.Rout’ to ‘solve_gas_test.Rout.save’ ... OK + Running ‘testthat.R’ + Running ‘unit_test.R’ + Comparing ‘unit_test.Rout’ to ‘unit_test.Rout.save’ ... OK +* checking for unstated dependencies in vignettes ... OK +* checking package vignettes ... OK +* checking re-building of vignette outputs ... OK +* DONE +Status: 2 NOTEs + + + + + ``` # immcp @@ -431,6 +634,286 @@ Status: 1 ERROR +``` +# imt + +
+ +* Version: 1.0.0 +* GitHub: https://github.com/google/imt +* Source code: https://github.com/cran/imt +* Date/Publication: 2024-09-02 21:40:10 UTC +* Number of recursive dependencies: 131 + +Run `revdepcheck::cloud_details(, "imt")` for more info + +
+ +## Error before installation + +### Devel + +``` + + + + + + +``` +### CRAN + +``` +* using log directory ‘/tmp/workdir/imt/old/imt.Rcheck’ +* using R version 4.4.0 (2024-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 + GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 +* running under: Ubuntu 24.04.2 LTS +* using session charset: UTF-8 +* using option ‘--no-manual’ +* checking for file ‘imt/DESCRIPTION’ ... OK +... +GNU make is a SystemRequirements. +* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK +* checking use of PKG_*FLAGS in Makefiles ... OK +* checking compiled code ... OK +* checking examples ... OK +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... OK + Running ‘testthat.R’ +* DONE +Status: 2 NOTEs + + + + + +``` +# intervalpsych + +
+ +* Version: 0.1.0 +* GitHub: https://github.com/matthiaskloft/intervalpsych +* Source code: https://github.com/cran/intervalpsych +* Date/Publication: 2025-07-08 09:20:02 UTC +* Number of recursive dependencies: 64 + +Run `revdepcheck::cloud_details(, "intervalpsych")` for more info + +
+ +## Error before installation + +### Devel + +``` + + + + + + +``` +### CRAN + +``` +* using log directory ‘/tmp/workdir/intervalpsych/old/intervalpsych.Rcheck’ +* using R version 4.4.0 (2024-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 + GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 +* running under: Ubuntu 24.04.2 LTS +* using session charset: UTF-8 +* using option ‘--no-manual’ +* checking for file ‘intervalpsych/DESCRIPTION’ ... OK +... +GNU make is a SystemRequirements. +* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK +* checking use of PKG_*FLAGS in Makefiles ... OK +* checking compiled code ... OK +* checking examples ... OK +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... OK + Running ‘testthat.R’ +* DONE +Status: 2 NOTEs + + + + + +``` +# irtQ + +
+ +* Version: 1.0.0 +* GitHub: NA +* Source code: https://github.com/cran/irtQ +* Date/Publication: 2025-07-17 04:00:02 UTC +* Number of recursive dependencies: 88 + +Run `revdepcheck::cloud_details(, "irtQ")` for more info + +
+ +## Error before installation + +### Devel + +``` + + + + + + +``` +### CRAN + +``` +* using log directory ‘/tmp/workdir/irtQ/old/irtQ.Rcheck’ +* using R version 4.4.0 (2024-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 + GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 +* running under: Ubuntu 24.04.2 LTS +* using session charset: UTF-8 +* using option ‘--no-manual’ +* checking for file ‘irtQ/DESCRIPTION’ ... OK +... +* checking Rd \usage sections ... OK +* checking Rd contents ... OK +* checking for unstated dependencies in examples ... OK +* checking contents of ‘data’ directory ... OK +* checking data for non-ASCII characters ... OK +* checking LazyData ... OK +* checking data for ASCII and uncompressed saves ... OK +* checking examples ... OK +* DONE +Status: 1 NOTE + + + + + +``` +# isotracer + +
+ +* Version: 1.1.8 +* GitHub: NA +* Source code: https://github.com/cran/isotracer +* Date/Publication: 2025-03-07 18:50:02 UTC +* Number of recursive dependencies: 122 + +Run `revdepcheck::cloud_details(, "isotracer")` for more info + +
+ +## Error before installation + +### Devel + +``` + + + + + + +``` +### CRAN + +``` +* using log directory ‘/tmp/workdir/isotracer/old/isotracer.Rcheck’ +* using R version 4.4.0 (2024-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 + GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 +* running under: Ubuntu 24.04.2 LTS +* using session charset: UTF-8 +* using option ‘--no-manual’ +* checking for file ‘isotracer/DESCRIPTION’ ... OK +... +* checking files in ‘vignettes’ ... OK +* checking examples ... OK +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... OK + Running ‘testthat.R’ +* checking for unstated dependencies in vignettes ... OK +* checking package vignettes ... OK +* checking re-building of vignette outputs ... OK +* DONE +Status: 3 NOTEs + + + + + +``` +# jpcity + +
+ +* Version: 0.3.0 +* GitHub: https://github.com/UchidaMizuki/jpcity +* Source code: https://github.com/cran/jpcity +* Date/Publication: 2024-10-04 14:30:02 UTC +* Number of recursive dependencies: 38 + +Run `revdepcheck::cloud_details(, "jpcity")` for more info + +
+ +## Error before installation + +### Devel + +``` + + + + + + +``` +### CRAN + +``` +* using log directory ‘/tmp/workdir/jpcity/old/jpcity.Rcheck’ +* using R version 4.4.0 (2024-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 + GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 +* running under: Ubuntu 24.04.2 LTS +* using session charset: UTF-8 +* using option ‘--no-manual’ +* checking for file ‘jpcity/DESCRIPTION’ ... OK +... +* checking Rd \usage sections ... OK +* checking Rd contents ... OK +* checking for unstated dependencies in examples ... OK +* checking R/sysdata.rda ... OK +* checking examples ... OK +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... OK + Running ‘testthat.R’ +* DONE +Status: OK + + + + + ``` # kerastuneR @@ -973,124 +1456,28 @@ ERROR: lazy loading failed for package ‘rdflib’ * removing ‘/tmp/workdir/rdflib/old/rdflib.Rcheck/rdflib’ -``` -# RVA - -
- -* Version: 0.0.5 -* GitHub: https://github.com/THERMOSTATS/RVA -* Source code: https://github.com/cran/RVA -* Date/Publication: 2021-11-01 21:40:02 UTC -* Number of recursive dependencies: 209 - -Run `revdepcheck::cloud_details(, "RVA")` for more info - -
- -## Error before installation - -### Devel - -``` -* using log directory ‘/tmp/workdir/RVA/new/RVA.Rcheck’ -* using R version 4.4.0 (2024-04-24) -* using platform: x86_64-pc-linux-gnu -* R was compiled by - gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 - GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 -* running under: Ubuntu 24.04.2 LTS -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘RVA/DESCRIPTION’ ... OK -... -* this is package ‘RVA’ version ‘0.0.5’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... ERROR -Package required but not available: ‘clusterProfiler’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -* DONE -Status: 1 ERROR - - - - - -``` -### CRAN - -``` -* using log directory ‘/tmp/workdir/RVA/old/RVA.Rcheck’ -* using R version 4.4.0 (2024-04-24) -* using platform: x86_64-pc-linux-gnu -* R was compiled by - gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 - GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 -* running under: Ubuntu 24.04.2 LTS -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘RVA/DESCRIPTION’ ... OK -... -* this is package ‘RVA’ version ‘0.0.5’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... ERROR -Package required but not available: ‘clusterProfiler’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -* DONE -Status: 1 ERROR - - - - - -``` -# SCpubr - -
- -* Version: 3.0.0 -* GitHub: https://github.com/enblacar/SCpubr -* Source code: https://github.com/cran/SCpubr -* Date/Publication: 2025-08-20 08:40:02 UTC -* Number of recursive dependencies: 289 - -Run `revdepcheck::cloud_details(, "SCpubr")` for more info - -
- -## Error before installation - -### Devel - -``` -* using log directory ‘/tmp/workdir/SCpubr/new/SCpubr.Rcheck’ -* using R version 4.4.0 (2024-04-24) -* using platform: x86_64-pc-linux-gnu -* R was compiled by - gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 - GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 -* running under: Ubuntu 24.04.2 LTS -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘SCpubr/DESCRIPTION’ ... OK -... -* checking files in ‘vignettes’ ... OK -* checking examples ... OK -* checking for unstated dependencies in ‘tests’ ... OK -* checking tests ... OK - Running ‘testthat.R’ -* checking for unstated dependencies in vignettes ... OK -* checking package vignettes ... OK -* checking re-building of vignette outputs ... OK -* DONE -Status: 1 NOTE - +``` +# rmweather + +
+ +* Version: 0.2.63 +* GitHub: https://github.com/skgrange/rmweather +* Source code: https://github.com/cran/rmweather +* Date/Publication: 2025-08-22 17:10:02 UTC +* Number of recursive dependencies: 84 + +Run `revdepcheck::cloud_details(, "rmweather")` for more info + +
+ +## Error before installation + +### Devel + +``` + + @@ -1099,7 +1486,7 @@ Status: 1 NOTE ### CRAN ``` -* using log directory ‘/tmp/workdir/SCpubr/old/SCpubr.Rcheck’ +* using log directory ‘/tmp/workdir/rmweather/old/rmweather.Rcheck’ * using R version 4.4.0 (2024-04-24) * using platform: x86_64-pc-linux-gnu * R was compiled by @@ -1108,35 +1495,35 @@ Status: 1 NOTE * running under: Ubuntu 24.04.2 LTS * using session charset: UTF-8 * using option ‘--no-manual’ -* checking for file ‘SCpubr/DESCRIPTION’ ... OK +* checking for file ‘rmweather/DESCRIPTION’ ... OK ... -* checking files in ‘vignettes’ ... OK +* checking contents of ‘data’ directory ... OK +* checking data for non-ASCII characters ... OK +* checking LazyData ... OK +* checking data for ASCII and uncompressed saves ... OK * checking examples ... OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... OK Running ‘testthat.R’ -* checking for unstated dependencies in vignettes ... OK -* checking package vignettes ... OK -* checking re-building of vignette outputs ... OK * DONE -Status: 1 NOTE +Status: OK ``` -# sprtt +# rstanemax
-* Version: 0.2.0 -* GitHub: https://github.com/MeikeSteinhilber/sprtt -* Source code: https://github.com/cran/sprtt -* Date/Publication: 2023-07-06 13:50:02 UTC -* Number of recursive dependencies: 146 +* Version: 0.1.9 +* GitHub: https://github.com/yoshidk6/rstanemax +* Source code: https://github.com/cran/rstanemax +* Date/Publication: 2025-02-17 07:30:01 UTC +* Number of recursive dependencies: 93 -Run `revdepcheck::cloud_details(, "sprtt")` for more info +Run `revdepcheck::cloud_details(, "rstanemax")` for more info
@@ -1145,27 +1532,7 @@ Run `revdepcheck::cloud_details(, "sprtt")` for more info ### Devel ``` -* using log directory ‘/tmp/workdir/sprtt/new/sprtt.Rcheck’ -* using R version 4.4.0 (2024-04-24) -* using platform: x86_64-pc-linux-gnu -* R was compiled by - gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 - GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 -* running under: Ubuntu 24.04.2 LTS -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘sprtt/DESCRIPTION’ ... OK -... -* this is package ‘sprtt’ version ‘0.2.0’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... ERROR -Package required but not available: ‘MBESS’ -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -* DONE -Status: 1 ERROR @@ -1175,7 +1542,7 @@ Status: 1 ERROR ### CRAN ``` -* using log directory ‘/tmp/workdir/sprtt/old/sprtt.Rcheck’ +* using log directory ‘/tmp/workdir/rstanemax/old/rstanemax.Rcheck’ * using R version 4.4.0 (2024-04-24) * using platform: x86_64-pc-linux-gnu * R was compiled by @@ -1184,35 +1551,35 @@ Status: 1 ERROR * running under: Ubuntu 24.04.2 LTS * using session charset: UTF-8 * using option ‘--no-manual’ -* checking for file ‘sprtt/DESCRIPTION’ ... OK +* checking for file ‘rstanemax/DESCRIPTION’ ... OK ... -* this is package ‘sprtt’ version ‘0.2.0’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... ERROR -Package required but not available: ‘MBESS’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. +* checking examples ... OK +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... OK + Running ‘spelling.R’ + Running ‘testthat.R’ +* checking for unstated dependencies in vignettes ... OK +* checking package vignettes ... OK +* checking re-building of vignette outputs ... OK * DONE -Status: 1 ERROR +Status: 2 NOTEs ``` -# ssdGSA +# RVA
-* Version: 0.1.1 -* GitHub: NA -* Source code: https://github.com/cran/ssdGSA -* Date/Publication: 2024-07-26 23:10:02 UTC -* Number of recursive dependencies: 170 +* Version: 0.0.5 +* GitHub: https://github.com/THERMOSTATS/RVA +* Source code: https://github.com/cran/RVA +* Date/Publication: 2021-11-01 21:40:02 UTC +* Number of recursive dependencies: 209 -Run `revdepcheck::cloud_details(, "ssdGSA")` for more info +Run `revdepcheck::cloud_details(, "RVA")` for more info
@@ -1221,7 +1588,7 @@ Run `revdepcheck::cloud_details(, "ssdGSA")` for more info ### Devel ``` -* using log directory ‘/tmp/workdir/ssdGSA/new/ssdGSA.Rcheck’ +* using log directory ‘/tmp/workdir/RVA/new/RVA.Rcheck’ * using R version 4.4.0 (2024-04-24) * using platform: x86_64-pc-linux-gnu * R was compiled by @@ -1230,9 +1597,9 @@ Run `revdepcheck::cloud_details(, "ssdGSA")` for more info * running under: Ubuntu 24.04.2 LTS * using session charset: UTF-8 * using option ‘--no-manual’ -* checking for file ‘ssdGSA/DESCRIPTION’ ... OK +* checking for file ‘RVA/DESCRIPTION’ ... OK ... -* this is package ‘ssdGSA’ version ‘0.1.1’ +* this is package ‘RVA’ version ‘0.0.5’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... ERROR @@ -1251,7 +1618,7 @@ Status: 1 ERROR ### CRAN ``` -* using log directory ‘/tmp/workdir/ssdGSA/old/ssdGSA.Rcheck’ +* using log directory ‘/tmp/workdir/RVA/old/RVA.Rcheck’ * using R version 4.4.0 (2024-04-24) * using platform: x86_64-pc-linux-gnu * R was compiled by @@ -1260,9 +1627,9 @@ Status: 1 ERROR * running under: Ubuntu 24.04.2 LTS * using session charset: UTF-8 * using option ‘--no-manual’ -* checking for file ‘ssdGSA/DESCRIPTION’ ... OK +* checking for file ‘RVA/DESCRIPTION’ ... OK ... -* this is package ‘ssdGSA’ version ‘0.1.1’ +* this is package ‘RVA’ version ‘0.0.5’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... ERROR @@ -1278,80 +1645,73 @@ Status: 1 ERROR ``` -# stoRy +# sampler
-* Version: 0.2.2 -* GitHub: https://github.com/theme-ontology/stoRy -* Source code: https://github.com/cran/stoRy -* Date/Publication: 2023-06-13 23:10:02 UTC -* Number of recursive dependencies: 76 +* Version: 0.2.4 +* GitHub: https://github.com/mbaldassaro/sampler +* Source code: https://github.com/cran/sampler +* Date/Publication: 2019-09-15 15:40:02 UTC +* Number of recursive dependencies: 23 -Run `revdepcheck::cloud_details(, "stoRy")` for more info +Run `revdepcheck::cloud_details(, "sampler")` for more info
-## Newly broken - -* checking whether package ‘stoRy’ can be installed ... ERROR - ``` - Installation failed. - See ‘/tmp/workdir/stoRy/new/stoRy.Rcheck/00install.out’ for details. - ``` - -## Installation +## Error before installation ### Devel ``` -* installing *source* package ‘stoRy’ ... -** package ‘stoRy’ successfully unpacked and MD5 sums checked -** using staged installation -** R -Warning: namespace ‘stoRy’ is not available and has been replaced -by .GlobalEnv when processing object ‘background_collection’ -** inst -** byte-compile and prepare package for lazy loading -Error: object ‘at_depth’ is not exported by 'namespace:purrr' -Execution halted -ERROR: lazy loading failed for package ‘stoRy’ -* removing ‘/tmp/workdir/stoRy/new/stoRy.Rcheck/stoRy’ + + + + ``` ### CRAN ``` -* installing *source* package ‘stoRy’ ... -** package ‘stoRy’ successfully unpacked and MD5 sums checked -** using staged installation -** R -** inst -** byte-compile and prepare package for lazy loading -** help -*** installing help indices -*** copying figures -** building package indices -** installing vignettes -** testing if installed package can be loaded from temporary location -** testing if installed package can be loaded from final location -** testing if installed package keeps a record of temporary installation path -* DONE (stoRy) +* using log directory ‘/tmp/workdir/sampler/old/sampler.Rcheck’ +* using R version 4.4.0 (2024-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 + GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 +* running under: Ubuntu 24.04.2 LTS +* using session charset: UTF-8 +* using option ‘--no-manual’ +* checking for file ‘sampler/DESCRIPTION’ ... OK +... +* checking Rd \usage sections ... OK +* checking Rd contents ... OK +* checking for unstated dependencies in examples ... OK +* checking contents of ‘data’ directory ... OK +* checking data for non-ASCII characters ... OK +* checking LazyData ... OK +* checking data for ASCII and uncompressed saves ... OK +* checking examples ... OK +* DONE +Status: OK + + + ``` -# Surrogate +# sbm
-* Version: 3.4.1 -* GitHub: https://github.com/florianstijven/Surrogate-development -* Source code: https://github.com/cran/Surrogate -* Date/Publication: 2025-04-29 04:40:02 UTC -* Number of recursive dependencies: 193 +* Version: 0.4.7 +* GitHub: https://github.com/GrossSBM/sbm +* Source code: https://github.com/cran/sbm +* Date/Publication: 2024-09-16 18:40:09 UTC +* Number of recursive dependencies: 102 -Run `revdepcheck::cloud_details(, "Surrogate")` for more info +Run `revdepcheck::cloud_details(, "sbm")` for more info
@@ -1360,27 +1720,7 @@ Run `revdepcheck::cloud_details(, "Surrogate")` for more info ### Devel ``` -* using log directory ‘/tmp/workdir/Surrogate/new/Surrogate.Rcheck’ -* using R version 4.4.0 (2024-04-24) -* using platform: x86_64-pc-linux-gnu -* R was compiled by - gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 - GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 -* running under: Ubuntu 24.04.2 LTS -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘Surrogate/DESCRIPTION’ ... OK -... -* this is package ‘Surrogate’ version ‘3.4.1’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... ERROR -Package required but not available: ‘MBESS’ -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -* DONE -Status: 1 ERROR @@ -1390,7 +1730,7 @@ Status: 1 ERROR ### CRAN ``` -* using log directory ‘/tmp/workdir/Surrogate/old/Surrogate.Rcheck’ +* using log directory ‘/tmp/workdir/sbm/old/sbm.Rcheck’ * using R version 4.4.0 (2024-04-24) * using platform: x86_64-pc-linux-gnu * R was compiled by @@ -1399,35 +1739,35 @@ Status: 1 ERROR * running under: Ubuntu 24.04.2 LTS * using session charset: UTF-8 * using option ‘--no-manual’ -* checking for file ‘Surrogate/DESCRIPTION’ ... OK +* checking for file ‘sbm/DESCRIPTION’ ... OK ... -* this is package ‘Surrogate’ version ‘3.4.1’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... ERROR -Package required but not available: ‘MBESS’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. +* checking examples ... OK +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... OK + Running ‘spelling.R’ + Running ‘testthat.R’ +* checking for unstated dependencies in vignettes ... OK +* checking package vignettes ... OK +* checking re-building of vignette outputs ... OK * DONE -Status: 1 ERROR +Status: OK ``` -# tidybins +# SCpubr
-* Version: 0.1.1 -* GitHub: https://github.com/Harrison4192/tidybins -* Source code: https://github.com/cran/tidybins -* Date/Publication: 2024-06-12 04:50:02 UTC -* Number of recursive dependencies: 222 +* Version: 3.0.0 +* GitHub: https://github.com/enblacar/SCpubr +* Source code: https://github.com/cran/SCpubr +* Date/Publication: 2025-08-20 08:40:02 UTC +* Number of recursive dependencies: 289 -Run `revdepcheck::cloud_details(, "tidybins")` for more info +Run `revdepcheck::cloud_details(, "SCpubr")` for more info
@@ -1436,7 +1776,7 @@ Run `revdepcheck::cloud_details(, "tidybins")` for more info ### Devel ``` -* using log directory ‘/tmp/workdir/tidybins/new/tidybins.Rcheck’ +* using log directory ‘/tmp/workdir/SCpubr/new/SCpubr.Rcheck’ * using R version 4.4.0 (2024-04-24) * using platform: x86_64-pc-linux-gnu * R was compiled by @@ -1445,18 +1785,18 @@ Run `revdepcheck::cloud_details(, "tidybins")` for more info * running under: Ubuntu 24.04.2 LTS * using session charset: UTF-8 * using option ‘--no-manual’ -* checking for file ‘tidybins/DESCRIPTION’ ... OK +* checking for file ‘SCpubr/DESCRIPTION’ ... OK ... - 23. └─base::.handleSimpleError(...) - 24. └─purrr (local) h(simpleError(msg, call)) - 25. └─cli::cli_abort(...) - 26. └─rlang::abort(...) -Execution halted +* checking files in ‘vignettes’ ... OK +* checking examples ... OK +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... OK + Running ‘testthat.R’ * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking re-building of vignette outputs ... OK * DONE -Status: 1 ERROR, 3 NOTEs +Status: 1 NOTE @@ -1466,7 +1806,7 @@ Status: 1 ERROR, 3 NOTEs ### CRAN ``` -* using log directory ‘/tmp/workdir/tidybins/old/tidybins.Rcheck’ +* using log directory ‘/tmp/workdir/SCpubr/old/SCpubr.Rcheck’ * using R version 4.4.0 (2024-04-24) * using platform: x86_64-pc-linux-gnu * R was compiled by @@ -1475,35 +1815,35 @@ Status: 1 ERROR, 3 NOTEs * running under: Ubuntu 24.04.2 LTS * using session charset: UTF-8 * using option ‘--no-manual’ -* checking for file ‘tidybins/DESCRIPTION’ ... OK +* checking for file ‘SCpubr/DESCRIPTION’ ... OK ... -* checking Rd contents ... OK -* checking for unstated dependencies in examples ... OK -* checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... OK +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... OK + Running ‘testthat.R’ * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking re-building of vignette outputs ... OK * DONE -Status: 3 NOTEs +Status: 1 NOTE ``` -# tidycomm +# Surrogate
-* Version: 0.4.2 -* GitHub: https://github.com/tidycomm/tidycomm -* Source code: https://github.com/cran/tidycomm -* Date/Publication: 2025-08-27 12:00:02 UTC -* Number of recursive dependencies: 141 +* Version: 3.4.1 +* GitHub: https://github.com/florianstijven/Surrogate-development +* Source code: https://github.com/cran/Surrogate +* Date/Publication: 2025-04-29 04:40:02 UTC +* Number of recursive dependencies: 193 -Run `revdepcheck::cloud_details(, "tidycomm")` for more info +Run `revdepcheck::cloud_details(, "Surrogate")` for more info
@@ -1512,7 +1852,7 @@ Run `revdepcheck::cloud_details(, "tidycomm")` for more info ### Devel ``` -* using log directory ‘/tmp/workdir/tidycomm/new/tidycomm.Rcheck’ +* using log directory ‘/tmp/workdir/Surrogate/new/Surrogate.Rcheck’ * using R version 4.4.0 (2024-04-24) * using platform: x86_64-pc-linux-gnu * R was compiled by @@ -1521,9 +1861,9 @@ Run `revdepcheck::cloud_details(, "tidycomm")` for more info * running under: Ubuntu 24.04.2 LTS * using session charset: UTF-8 * using option ‘--no-manual’ -* checking for file ‘tidycomm/DESCRIPTION’ ... OK +* checking for file ‘Surrogate/DESCRIPTION’ ... OK ... -* this is package ‘tidycomm’ version ‘0.4.2’ +* this is package ‘Surrogate’ version ‘3.4.1’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... ERROR @@ -1542,7 +1882,7 @@ Status: 1 ERROR ### CRAN ``` -* using log directory ‘/tmp/workdir/tidycomm/old/tidycomm.Rcheck’ +* using log directory ‘/tmp/workdir/Surrogate/old/Surrogate.Rcheck’ * using R version 4.4.0 (2024-04-24) * using platform: x86_64-pc-linux-gnu * R was compiled by @@ -1551,9 +1891,9 @@ Status: 1 ERROR * running under: Ubuntu 24.04.2 LTS * using session charset: UTF-8 * using option ‘--no-manual’ -* checking for file ‘tidycomm/DESCRIPTION’ ... OK +* checking for file ‘Surrogate/DESCRIPTION’ ... OK ... -* this is package ‘tidycomm’ version ‘0.4.2’ +* this is package ‘Surrogate’ version ‘3.4.1’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... ERROR @@ -1568,85 +1908,6 @@ Status: 1 ERROR -``` -# tidyjson - -
- -* Version: 0.3.2 -* GitHub: https://github.com/colearendt/tidyjson -* Source code: https://github.com/cran/tidyjson -* Date/Publication: 2023-01-07 00:20:02 UTC -* Number of recursive dependencies: 91 - -Run `revdepcheck::cloud_details(, "tidyjson")` for more info - -
- -## Newly broken - -* checking whether package ‘tidyjson’ can be installed ... ERROR - ``` - Installation failed. - See ‘/tmp/workdir/tidyjson/new/tidyjson.Rcheck/00install.out’ for details. - ``` - -## Newly fixed - -* checking Rd files ... NOTE - ``` - checkRd: (-1) json_schema.Rd:33: Lost braces; missing escapes or markup? - 33 | \item object -> {"name": } e.g., {"age": 32} -> {"age": "number"} - | ^ - checkRd: (-1) json_schema.Rd:33: Lost braces; missing escapes or markup? - 33 | \item object -> {"name": } e.g., {"age": 32} -> {"age": "number"} - | ^ - checkRd: (-1) json_schema.Rd:33: Lost braces; missing escapes or markup? - 33 | \item object -> {"name": } e.g., {"age": 32} -> {"age": "number"} - | ^ - ``` - -## Installation - -### Devel - -``` -* installing *source* package ‘tidyjson’ ... -** package ‘tidyjson’ successfully unpacked and MD5 sums checked -** using staged installation -** R -** data -*** moving datasets to lazyload DB -** inst -** byte-compile and prepare package for lazy loading -Error: object ‘at_depth’ is not exported by 'namespace:purrr' -Execution halted -ERROR: lazy loading failed for package ‘tidyjson’ -* removing ‘/tmp/workdir/tidyjson/new/tidyjson.Rcheck/tidyjson’ - - -``` -### CRAN - -``` -* installing *source* package ‘tidyjson’ ... -** package ‘tidyjson’ successfully unpacked and MD5 sums checked -** using staged installation -** R -** data -*** moving datasets to lazyload DB -** inst -** byte-compile and prepare package for lazy loading -** help -*** installing help indices -** building package indices -** installing vignettes -** testing if installed package can be loaded from temporary location -** testing if installed package can be loaded from final location -** testing if installed package keeps a record of temporary installation path -* DONE (tidyjson) - - ``` # TriDimRegression diff --git a/revdep/problems.md b/revdep/problems.md index d8d43bd7..f5140143 100644 --- a/revdep/problems.md +++ b/revdep/problems.md @@ -1,35 +1,3 @@ -# autothresholdr - -
- -* Version: 1.4.2 -* GitHub: https://github.com/rorynolan/autothresholdr -* Source code: https://github.com/cran/autothresholdr -* Date/Publication: 2023-12-13 06:00:02 UTC -* Number of recursive dependencies: 95 - -Run `revdepcheck::cloud_details(, "autothresholdr")` for more info - -
- -## Newly broken - -* checking re-building of vignette outputs ... ERROR - ``` - Error(s) in re-building vignettes: - --- re-building ‘finding-thresholds.Rmd’ using rmarkdown - ``` - -## In both - -* checking installed package size ... NOTE - ``` - installed size is 5.0Mb - sub-directories of 1Mb or more: - doc 1.8Mb - libs 2.5Mb - ``` - # casino
@@ -312,6 +280,37 @@ ERROR: lazy loading failed for package ‘kerastuneR’ ``` +# meta + +
+ +* Version: 8.2-1 +* GitHub: https://github.com/guido-s/meta +* Source code: https://github.com/cran/meta +* Date/Publication: 2025-09-01 17:00:13 UTC +* Number of recursive dependencies: 121 + +Run `revdepcheck::cloud_details(, "meta")` for more info + +
+ +## Newly broken + +* checking installed package size ... NOTE + ``` + installed size is 5.6Mb + sub-directories of 1Mb or more: + R 3.5Mb + help 1.5Mb + ``` + +## In both + +* checking Rd cross-references ... NOTE + ``` + Packages unavailable to check Rd xrefs: ‘metasens’, ‘robumeta’ + ``` + # moranajp
@@ -457,213 +456,3 @@ Run `revdepcheck::cloud_details(, "SCORPIUS")` for more info | ^ ``` -# stoRy - -
- -* Version: 0.2.2 -* GitHub: https://github.com/theme-ontology/stoRy -* Source code: https://github.com/cran/stoRy -* Date/Publication: 2023-06-13 23:10:02 UTC -* Number of recursive dependencies: 76 - -Run `revdepcheck::cloud_details(, "stoRy")` for more info - -
- -## Newly broken - -* checking whether package ‘stoRy’ can be installed ... ERROR - ``` - Installation failed. - See ‘/tmp/workdir/stoRy/new/stoRy.Rcheck/00install.out’ for details. - ``` - -## Installation - -### Devel - -``` -* installing *source* package ‘stoRy’ ... -** package ‘stoRy’ successfully unpacked and MD5 sums checked -** using staged installation -** R -Warning: namespace ‘stoRy’ is not available and has been replaced -by .GlobalEnv when processing object ‘background_collection’ -** inst -** byte-compile and prepare package for lazy loading -Error: object ‘at_depth’ is not exported by 'namespace:purrr' -Execution halted -ERROR: lazy loading failed for package ‘stoRy’ -* removing ‘/tmp/workdir/stoRy/new/stoRy.Rcheck/stoRy’ - - -``` -### CRAN - -``` -* installing *source* package ‘stoRy’ ... -** package ‘stoRy’ successfully unpacked and MD5 sums checked -** using staged installation -** R -** inst -** byte-compile and prepare package for lazy loading -** help -*** installing help indices -*** copying figures -** building package indices -** installing vignettes -** testing if installed package can be loaded from temporary location -** testing if installed package can be loaded from final location -** testing if installed package keeps a record of temporary installation path -* DONE (stoRy) - - -``` -# tfrmt - -
- -* Version: 0.2.0 -* GitHub: https://github.com/GSK-Biostatistics/tfrmt -* Source code: https://github.com/cran/tfrmt -* Date/Publication: 2025-09-06 05:10:20 UTC -* Number of recursive dependencies: 93 - -Run `revdepcheck::cloud_details(, "tfrmt")` for more info - -
- -## Newly broken - -* checking examples ... ERROR - ``` - Running examples in ‘tfrmt-Ex.R’ failed - The error most likely occurred in: - - > ### Name: display_val_frmts - > ### Title: Display formatted values - > ### Aliases: display_val_frmts - > - > ### ** Examples - > - > tf_spec <- tfrmt( - ... - 24. ├─purrr::map_chr(., f_lhs) - 25. │ └─purrr:::map_("character", .x, .f, ..., .progress = .progress) - 26. │ ├─purrr:::with_indexed_errors(...) - 27. │ │ └─base::withCallingHandlers(...) - 28. │ └─purrr:::call_with_cleanup(...) - 29. └─base::.handleSimpleError(...) - 30. └─purrr (local) h(simpleError(msg, call)) - 31. └─cli::cli_abort(...) - 32. └─rlang::abort(...) - Execution halted - ``` - -## In both - -* checking tests ... ERROR - ``` - Running ‘testthat.R’ - Running the tests in ‘tests/testthat.R’ failed. - Complete output: - > library(testthat) - > library(tfrmt) - > - > test_check("tfrmt") - The following rows of the given dataset have no format applied to them 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 - The following rows of the given dataset have no format applied to them 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 - [ FAIL 13 | WARN 2 | SKIP 32 | PASS 572 ] - ... - 18. ├─gt::sub_missing(...) - 19. │ └─gt:::stop_if_not_gt_tbl(data = data) - 20. │ └─gt:::is_gt_tbl(data = data) - 21. └─gt::gt(., rowname_col = as_label(tfrmt$label)) - 22. └─cli::cli_abort(...) - 23. └─rlang::abort(...) - - [ FAIL 13 | WARN 2 | SKIP 32 | PASS 572 ] - Error: Test failures - Execution halted - ``` - -# tidyjson - -
- -* Version: 0.3.2 -* GitHub: https://github.com/colearendt/tidyjson -* Source code: https://github.com/cran/tidyjson -* Date/Publication: 2023-01-07 00:20:02 UTC -* Number of recursive dependencies: 91 - -Run `revdepcheck::cloud_details(, "tidyjson")` for more info - -
- -## Newly broken - -* checking whether package ‘tidyjson’ can be installed ... ERROR - ``` - Installation failed. - See ‘/tmp/workdir/tidyjson/new/tidyjson.Rcheck/00install.out’ for details. - ``` - -## Newly fixed - -* checking Rd files ... NOTE - ``` - checkRd: (-1) json_schema.Rd:33: Lost braces; missing escapes or markup? - 33 | \item object -> {"name": } e.g., {"age": 32} -> {"age": "number"} - | ^ - checkRd: (-1) json_schema.Rd:33: Lost braces; missing escapes or markup? - 33 | \item object -> {"name": } e.g., {"age": 32} -> {"age": "number"} - | ^ - checkRd: (-1) json_schema.Rd:33: Lost braces; missing escapes or markup? - 33 | \item object -> {"name": } e.g., {"age": 32} -> {"age": "number"} - | ^ - ``` - -## Installation - -### Devel - -``` -* installing *source* package ‘tidyjson’ ... -** package ‘tidyjson’ successfully unpacked and MD5 sums checked -** using staged installation -** R -** data -*** moving datasets to lazyload DB -** inst -** byte-compile and prepare package for lazy loading -Error: object ‘at_depth’ is not exported by 'namespace:purrr' -Execution halted -ERROR: lazy loading failed for package ‘tidyjson’ -* removing ‘/tmp/workdir/tidyjson/new/tidyjson.Rcheck/tidyjson’ - - -``` -### CRAN - -``` -* installing *source* package ‘tidyjson’ ... -** package ‘tidyjson’ successfully unpacked and MD5 sums checked -** using staged installation -** R -** data -*** moving datasets to lazyload DB -** inst -** byte-compile and prepare package for lazy loading -** help -*** installing help indices -** building package indices -** installing vignettes -** testing if installed package can be loaded from temporary location -** testing if installed package can be loaded from final location -** testing if installed package keeps a record of temporary installation path -* DONE (tidyjson) - - -``` diff --git a/src/every-some-none.c b/src/every-some-none.c new file mode 100644 index 00000000..223ef849 --- /dev/null +++ b/src/every-some-none.c @@ -0,0 +1,110 @@ +#define R_NO_REMAP +#include +#include +#include + +#include "conditions.h" + +/** + * Is `x` a scalar logical? + * + * Notably we bypass the class and any attributes, i.e. `structure(TRUE, foo = + * "bar", class = "my-class")` does count for these purrr functions for + * historical reasons. We also ignore any R level `length()` method, but that + * would be incredibly rare to see here. + */ +static inline +bool is_scalar_logicalish(SEXP x) { + return TYPEOF(x) == LGLSXP && Rf_xlength(x) == 1; +} + +/** + * C loop for `every()`, `some()`, and `none()` + * + * Uses `vctrs_vec_compat()` at the R level so that we can use `vec_size()` to + * compute `n`, while also using `[[` to extract elements, which is consistent + * with `map()`. + */ +static +SEXP satisfies_predicate( + SEXP env, + SEXP ffi_n, + SEXP ffi_i, + int initial, + int early_stop +) { + const int n = INTEGER_ELT(ffi_n, 0); + int* p_i = INTEGER(ffi_i); + + static SEXP call = NULL; + if (call == NULL) { + SEXP x_sym = Rf_install(".x"); + SEXP p_sym = Rf_install(".p"); + SEXP i_sym = Rf_install("i"); + + // Constructs a call of the form .p(.x[[i]], ...) + SEXP x_i_sym = PROTECT(Rf_lang3(R_Bracket2Symbol, x_sym, i_sym)); + + call = Rf_lang3(p_sym, x_i_sym, R_DotsSymbol); + R_PreserveObject(call); + + UNPROTECT(1); + } + + // Number of arguments within `call` to force. + // Same as `map()`. + const int force = 1; + + int out = initial; + + for (int i = 0; i < n; ++i) { + *p_i = i + 1; + + if (i % 1024 == 0) { + R_CheckUserInterrupt(); + } + + SEXP elt_sexp = PROTECT(R_forceAndCall(call, force, env)); + + if (!is_scalar_logicalish(elt_sexp)) { + // We don't pass `.purrr_error_call` through `.Call()` so we can avoid + // evaluating it when it isn't needed, so we have to retrieve it when + // required. + SEXP error_call = PROTECT(Rf_eval(Rf_install(".purrr_error_call"), env)); + + r_abort_call( + error_call, + "`.p()` must return a single `TRUE`, `FALSE`, or `NA`, not %s.", + rlang_obj_type_friendly_full(elt_sexp, true, false) + ); + } + + const int elt = LOGICAL_ELT(elt_sexp, 0); + UNPROTECT(1); + + if (elt == early_stop) { + // Early exit + out = !initial; + break; + } + + if (elt == NA_LOGICAL) { + // Propagate `NA`, but keep going + out = NA_LOGICAL; + } + } + + *p_i = 0; + + return Rf_ScalarLogical(out); +} + +SEXP every_impl(SEXP ffi_env, SEXP ffi_n, SEXP ffi_i) { + return satisfies_predicate(ffi_env, ffi_n, ffi_i, /*initial=*/ true, /*early_stop=*/ false); +} +SEXP some_impl(SEXP ffi_env, SEXP ffi_n, SEXP ffi_i) { + return satisfies_predicate(ffi_env, ffi_n, ffi_i, /*initial=*/ false, /*early_stop=*/ true); +} +SEXP none_impl(SEXP ffi_env, SEXP ffi_n, SEXP ffi_i) { + return satisfies_predicate(ffi_env, ffi_n, ffi_i, /*initial=*/ true, /*early_stop=*/ true); +} diff --git a/src/init.c b/src/init.c index 7c33bce9..458eea8a 100644 --- a/src/init.c +++ b/src/init.c @@ -13,6 +13,9 @@ extern SEXP coerce_impl(SEXP, SEXP); extern SEXP pluck_impl(SEXP, SEXP, SEXP, SEXP); extern SEXP flatten_impl(SEXP); +extern SEXP every_impl(SEXP, SEXP, SEXP); +extern SEXP some_impl(SEXP, SEXP, SEXP); +extern SEXP none_impl(SEXP, SEXP, SEXP); extern SEXP map_impl(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP); extern SEXP map2_impl(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP); extern SEXP pmap_impl(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP); @@ -24,6 +27,9 @@ static const R_CallMethodDef CallEntries[] = { {"coerce_impl", (DL_FUNC) &coerce_impl, 2}, {"pluck_impl", (DL_FUNC) &pluck_impl, 4}, {"flatten_impl", (DL_FUNC) &flatten_impl, 1}, + {"every_impl", (DL_FUNC) &every_impl, 3}, + {"some_impl", (DL_FUNC) &some_impl, 3}, + {"none_impl", (DL_FUNC) &none_impl, 3}, {"map_impl", (DL_FUNC) &map_impl, 6}, {"map2_impl", (DL_FUNC) &map2_impl, 6}, {"pmap_impl", (DL_FUNC) &pmap_impl, 8}, diff --git a/tests/testthat/_snaps/every-some-none.md b/tests/testthat/_snaps/every-some-none.md index 0b3bb46d..3d7cf2b7 100644 --- a/tests/testthat/_snaps/every-some-none.md +++ b/tests/testthat/_snaps/every-some-none.md @@ -1,16 +1,123 @@ -# every() requires logical value +# every(), some(), and none() require logical scalar predicate results Code - every(list(1:3), identity) + every(list(1), function(x) 1) Condition Error in `every()`: - ! `.p()` must return a single `TRUE` or `FALSE`, not an integer vector. + ! `.p()` must return a single `TRUE`, `FALSE`, or `NA`, not the number 1. --- Code - every(list(function() NULL), identity) + some(list(1), function(x) 1) + Condition + Error in `some()`: + ! `.p()` must return a single `TRUE`, `FALSE`, or `NA`, not the number 1. + +--- + + Code + none(list(1), function(x) 1) + Condition + Error in `none()`: + ! `.p()` must return a single `TRUE`, `FALSE`, or `NA`, not the number 1. + +--- + + Code + every(list(1), function(x) NA_integer_) Condition Error in `every()`: - ! `.p()` must return a single `TRUE` or `FALSE`, not a function. + ! `.p()` must return a single `TRUE`, `FALSE`, or `NA`, not an integer `NA`. + +--- + + Code + some(list(1), function(x) NA_integer_) + Condition + Error in `some()`: + ! `.p()` must return a single `TRUE`, `FALSE`, or `NA`, not an integer `NA`. + +--- + + Code + none(list(1), function(x) NA_integer_) + Condition + Error in `none()`: + ! `.p()` must return a single `TRUE`, `FALSE`, or `NA`, not an integer `NA`. + +--- + + Code + every(list(1), function(x) c(TRUE, FALSE)) + Condition + Error in `every()`: + ! `.p()` must return a single `TRUE`, `FALSE`, or `NA`, not a logical vector. + +--- + + Code + some(list(1), function(x) c(TRUE, FALSE)) + Condition + Error in `some()`: + ! `.p()` must return a single `TRUE`, `FALSE`, or `NA`, not a logical vector. + +--- + + Code + none(list(1), function(x) c(TRUE, FALSE)) + Condition + Error in `none()`: + ! `.p()` must return a single `TRUE`, `FALSE`, or `NA`, not a logical vector. + +# every(), some(), and none() require vector `.x` + + Code + every(function() 1, identity) + Condition + Error in `every()`: + ! `.x` must be a vector, not a function. + +--- + + Code + some(function() 1, identity) + Condition + Error in `some()`: + ! `.x` must be a vector, not a function. + +--- + + Code + none(function() 1, identity) + Condition + Error in `none()`: + ! `.x` must be a vector, not a function. + +# pairlists, expressions, and calls are deprecated but work + + Code + out <- every(expression(1, 2), is.double) + Condition + Warning: + Use of calls and expressions in purrr functions was deprecated in purrr 1.0.0. + i Please coerce explicitly with `as.list()` + +--- + + Code + out <- every(pairlist(1, 2), is.double) + Condition + Warning: + Use of pairlists in purrr functions was deprecated in purrr 1.0.0. + i Please coerce explicitly with `as.list()` + +--- + + Code + x <- every(quote(f(a, b)), is.name) + Condition + Warning: + Use of calls and expressions in purrr functions was deprecated in purrr 1.0.0. + i Please coerce explicitly with `as.list()` diff --git a/tests/testthat/_snaps/utils.md b/tests/testthat/_snaps/utils.md index 8b6645af..a858c66d 100644 --- a/tests/testthat/_snaps/utils.md +++ b/tests/testthat/_snaps/utils.md @@ -43,7 +43,7 @@ x <- vctrs_vec_compat(expression(1, 2), globalenv()) Condition Warning: - Use of calls and pairlists in map functions was deprecated in purrr 1.0.0. + Use of calls and expressions in purrr functions was deprecated in purrr 1.0.0. i Please coerce explicitly with `as.list()` --- @@ -52,7 +52,7 @@ x <- vctrs_vec_compat(pairlist(1, 2), globalenv()) Condition Warning: - Use of pairlists in map functions was deprecated in purrr 1.0.0. + Use of pairlists in purrr functions was deprecated in purrr 1.0.0. i Please coerce explicitly with `as.list()` --- @@ -61,7 +61,7 @@ x <- vctrs_vec_compat(quote(f(a, b = 1)), globalenv()) Condition Warning: - Use of calls and pairlists in map functions was deprecated in purrr 1.0.0. + Use of calls and expressions in purrr functions was deprecated in purrr 1.0.0. i Please coerce explicitly with `as.list()` # can't work with regular S4 objects diff --git a/tests/testthat/test-every-some-none.R b/tests/testthat/test-every-some-none.R index f9aa68d6..a1e3e802 100644 --- a/tests/testthat/test-every-some-none.R +++ b/tests/testthat/test-every-some-none.R @@ -16,11 +16,6 @@ test_that("none returns TRUE if all elements are FALSE", { expect_true(none(x[1], isTRUE)) }) -test_that("every() requires logical value", { - expect_snapshot(every(list(1:3), identity), error = TRUE) - expect_snapshot(every(list(function() NULL), identity), error = TRUE) -}) - test_that("every() has the same behaviour as `&&` (#751)", { expect_false(every(list(NA, FALSE), identity)) expect_false(every(list(FALSE, NA), identity)) @@ -38,3 +33,142 @@ test_that("some() has the same behaviour as `||`", { expect_identical(some(list(FALSE, NA), identity), NA) expect_identical(some(list(NA, NA), identity), NA) }) + +test_that("every(), some(), and none() have correct empty size behavior", { + # All pass + expect_identical(every(list(), identity), all(list())) + # All don't pass + expect_identical(none(list(), identity), all(list())) + # Any pass + expect_identical(some(list(), identity), any(list())) +}) + +test_that("every(), some(), and none() work on `NULL`", { + # All pass + expect_identical(every(NULL, identity), all(NULL)) + # All don't pass + expect_identical(none(NULL, identity), all(NULL)) + # Any pass + expect_identical(some(NULL, identity), any(NULL)) +}) + +test_that("every(), some(), and none() have correct early stopping behavior", { + expect_identical(every(list(TRUE, FALSE, TRUE), identity), FALSE) + expect_identical(none(list(FALSE, TRUE, FALSE), identity), FALSE) + expect_identical(some(list(FALSE, TRUE, FALSE), identity), TRUE) +}) + +test_that("every(), some(), and none() have correct `NA` propagation behavior", { + # Propagates through non-early-stopping case + expect_identical(every(list(NA, TRUE), identity), NA) + expect_identical(none(list(NA, FALSE), identity), NA) + expect_identical(some(list(NA, FALSE), identity), NA) + + # Overruled by early-stopping case + expect_identical(every(list(NA, FALSE), identity), FALSE) + expect_identical(none(list(NA, TRUE), identity), FALSE) + expect_identical(some(list(NA, TRUE), identity), TRUE) +}) + +test_that("every(), some(), and none() require logical scalar predicate results", { + # No coercion to `TRUE` or `FALSE` + expect_snapshot(every(list(1), function(x) 1), error = TRUE) + expect_snapshot(some(list(1), function(x) 1), error = TRUE) + expect_snapshot(none(list(1), function(x) 1), error = TRUE) + + # `NA` must be a logical `NA`, no coercion happens for `TRUE` or `FALSE`, + # so we also don't coerce `NA`s of any other kind + expect_snapshot(every(list(1), function(x) NA_integer_), error = TRUE) + expect_snapshot(some(list(1), function(x) NA_integer_), error = TRUE) + expect_snapshot(none(list(1), function(x) NA_integer_), error = TRUE) + + # Must be length 1 + expect_snapshot(every(list(1), function(x) c(TRUE, FALSE)), error = TRUE) + expect_snapshot(some(list(1), function(x) c(TRUE, FALSE)), error = TRUE) + expect_snapshot(none(list(1), function(x) c(TRUE, FALSE)), error = TRUE) + + # Attributes are allowed, we ignore them + expect_true(every(list(1), function(x) structure(TRUE, foo = "bar"))) + expect_true(some(list(1), function(x) structure(TRUE, foo = "bar"))) + expect_false(none(list(1), function(x) structure(TRUE, foo = "bar"))) + + # Classes are allowed for historical reasons. + # We probably wouldn't consider these to be logical scalars these days. + expect_true(every(list(1), function(x) structure(TRUE, class = "mylgl"))) + expect_true(some(list(1), function(x) structure(TRUE, class = "mylgl"))) + expect_false(none(list(1), function(x) structure(TRUE, class = "mylgl"))) + + # We bypass any S3 `length()` methods! + local_methods(length.mylgl = function(x) 2L) + expect_true(every(list(1), function(x) structure(TRUE, class = "mylgl"))) + expect_true(some(list(1), function(x) structure(TRUE, class = "mylgl"))) + expect_false(none(list(1), function(x) structure(TRUE, class = "mylgl"))) +}) + +test_that("every(), some(), and none() require vector `.x`", { + expect_snapshot(every(function() 1, identity), error = TRUE) + expect_snapshot(some(function() 1, identity), error = TRUE) + expect_snapshot(none(function() 1, identity), error = TRUE) +}) + +test_that("every(), some(), and none() work on atomic vectors", { + expect_identical(every(1:3, is.integer), TRUE) + expect_identical(none(1:3, is.integer), FALSE) + expect_identical(some(1:3, is.integer), TRUE) +}) + +test_that("every(), some(), and none() work colwise across data frames", { + # If it naively worked off `vec_size()` then extracted elements with `[[`, + # this would return incorrect results. This definition is consistent with + # `map()`. + df <- data_frame(a = 1L, b = 2) + expect_identical(every(df, is.integer), FALSE) + expect_identical(none(df, is.double), FALSE) + expect_identical(some(df, is.double), TRUE) +}) + +test_that("every(), some(), and none() work on list scalars", { + # For consistency with `map()` + obj <- structure(list(1, "x"), class = "my_scalar") + expect_identical(every(obj, is.double), FALSE) + expect_identical(none(obj, is.character), FALSE) + expect_identical(some(obj, is.character), TRUE) +}) + +test_that("every(), some(), and none() work with vctrs records", { + x <- new_rcrd(list(x = c(1, 2, 3), y = c("a", "b", "c"))) + + out <- list() + every(x, function(elt) { + out <<- append(out, list(elt)) + TRUE + }) + expect_identical(out, vec_chop(x)) + + out <- list() + some(x, function(elt) { + out <<- append(out, list(elt)) + FALSE + }) + expect_identical(out, vec_chop(x)) + + out <- list() + none(x, function(elt) { + out <<- append(out, list(elt)) + FALSE + }) + expect_identical(out, vec_chop(x)) +}) + +test_that("pairlists, expressions, and calls are deprecated but work", { + local_options(lifecycle_verbosity = "warning") + + expect_snapshot(out <- every(expression(1, 2), is.double)) + expect_true(out) + + expect_snapshot(out <- every(pairlist(1, 2), is.double)) + expect_true(out) + + expect_snapshot(x <- every(quote(f(a, b)), is.name)) + expect_true(out) +}) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 5680762c..34da9be8 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -54,6 +54,8 @@ test_that("arrays become vectors (#970)", { }) test_that("pairlists, expressions, and calls are deprecated", { + local_options(lifecycle_verbosity = "warning") + expect_snapshot(x <- vctrs_vec_compat(expression(1, 2), globalenv())) expect_equal(x, list(1, 2)) diff --git a/vignettes/purrr.Rmd b/vignettes/purrr.Rmd index 867d5084..10ab67a3 100644 --- a/vignettes/purrr.Rmd +++ b/vignettes/purrr.Rmd @@ -58,10 +58,10 @@ str(out) Even on its own, there are some benefits to `map()`: once you get used to the syntax, it's a very compact way to express the idea of transforming a vector, returning one output element for each input element. But there are several other reasons to use `map()`, which we'll explore in the following sections: -* Progress bars -* Parallel computing -* Output variants -* Input variants +- Progress bars +- Parallel computing +- Output variants +- Input variants ### Progress bars @@ -78,12 +78,13 @@ Learn more about progress bars in `?progress_bars`. By default, `map()` runs only in your current R session. But you can easily opt in to spreading your task across multiple R sessions, and hence multiple cores with `in_parallel()`. This can give big performance improvements if your task is primarily bound by compute performance. -purrr's parallelism is powered by mirai, so to begin, you need to start up a number of background R sessions, called __daemons__: +purrr's parallelism is powered by mirai, so to begin, you need to start up a number of background R sessions, called **daemons**: ```{r} #| eval: false mirai::daemons(6) ``` + ```{r} #| echo: false # Can be updated to mirai::daemons(sync = TRUE) once mirai >= 2.5.1 is released @@ -122,17 +123,18 @@ Learn more about parallel computing in `?in_parallel`. purrr functions are type-stable, which means it's easy to predict what type of output they return, e.g., `map()` always returns a list. But what if you want a different type of output? That's where the output variants come into play: -* There are four variants for the four most important types of atomic vector: - * `map_lgl()` returns a logical vector. - * `map_int()` returns an integer vector. - * `map_dbl()` returns a numeric (double) vector. - * `map_chr()` returns a character vector. +- There are four variants for the four most important types of atomic vector: + + - `map_lgl()` returns a logical vector. + - `map_int()` returns an integer vector. + - `map_dbl()` returns a numeric (double) vector. + - `map_chr()` returns a character vector. -* For all other types of vector (like dates, date-times, factors, etc.), there's `map_vec()`. It's a little harder to precisely describe the output type, but if your function returns a length-1 vector of type "foo", then the output of `map_vec()` will be a length-n vector of type "foo". +- For all other types of vector (like dates, date-times, factors, etc.), there's `map_vec()`. It's a little harder to precisely describe the output type, but if your function returns a length-1 vector of type "foo", then the output of `map_vec()` will be a length-n vector of type "foo". -* `modify()` returns output with the same type as the input. For example, if the input is a data frame, the output will also be a data frame. +- `modify()` returns output with the same type as the input. For example, if the input is a data frame, the output will also be a data frame. -* `walk()` returns the input (invisibly); it's useful when you're calling a function purely for its side effects, for example, generating plots or saving files. +- `walk()` returns the input (invisibly); it's useful when you're calling a function purely for its side effects, for example, generating plots or saving files. purrr, like many tidyverse functions, is designed to help you solve complex problems by stringing together simple pieces. This is particularly natural to do with the pipe. For example, the following code splits `mtcars` into one data frame for each value of `cyl`, fits a linear model to each subset, computes the model summary, and then extracts the R-squared: @@ -186,7 +188,7 @@ There are two important variants of `map2()`: `pmap()` which can take any number What makes purrr particularly special is that all of the above features (progress bars, parallel computing, output variants, and input variants) can be combined any way that you choose. The combination of inputs (prefixes) and outputs (suffixes) forms a matrix, and you can use `.progress` or `in_parallel()` with any of them: | Output type | Single input (`.x`) | Two inputs (`.x`, `.y`) | Multiple inputs (`.l`) | -|-------------|-------------------|---------------------|----------------------| +|-----------------|-----------------|-------------------|--------------------| | **List** | `map(.x, .f)` | `map2(.x, .y, .f)` | `pmap(.l, .f)` | | **Logical** | `map_lgl(.x, .f)` | `map2_lgl(.x, .y, .f)` | `pmap_lgl(.l, .f)` | | **Integer** | `map_int(.x, .f)` | `map2_int(.x, .y, .f)` | `pmap_int(.l, .f)` | @@ -198,19 +200,20 @@ What makes purrr particularly special is that all of the above features (progres ## Filtering and finding with predicates + purrr provides a number of functions that work with predicate functions. Predicate functions take a vector and return either `TRUE` or `FALSE`, with examples including `is.character()` and `\(x) any(is.na(x))`. You typically use them to filter or find; for example, you could use them to locate the first element of a list that's a character vector, or only keep the columns in a data frame that have missing values. purrr comes with a bunch of helpers to make predicate functions easier to use: -* `detect(.x, .p)` returns the value of the first element in `.x` where `.p` is `TRUE`. -* `detect_index(.x, .p)` returns the position of the first element in `.x` where `.p` is `TRUE`. -* `keep(.x, .p)` returns all elements from `.x` where `.p` evaluates to `TRUE`. -* `discard(.x, .p)` returns all elements from `.x` where `.p` evaluates to `FALSE`. -* `every(.x, .p)` returns `TRUE` if `.p` returns `TRUE` for every element in `.x`. -* `some(.x, .p)` returns `TRUE` if `.p` returns `TRUE` for at least one element in `.x`. -* `none(.x, .p)` returns `TRUE` if `.p` returns `FALSE` for all elements in `.x`. -* `head_while(.x, .p)` returns elements from the beginning of `.x` while `.p` is `TRUE`, stopping at the first `FALSE`. -* `tail_while(.x, .p)` returns elements from the end of `.x` while `.p` is `TRUE`, stopping at the first `FALSE`. +- `detect(.x, .p)` returns the value of the first element in `.x` where `.p` is `TRUE`. +- `detect_index(.x, .p)` returns the position of the first element in `.x` where `.p` is `TRUE`. +- `keep(.x, .p)` returns all elements from `.x` where `.p` evaluates to `TRUE`. +- `discard(.x, .p)` returns all elements from `.x` where `.p` evaluates to `FALSE`. +- `every(.x, .p)` returns `TRUE` if `.p` returns `TRUE` for every element in `.x`. +- `some(.x, .p)` returns `TRUE` if `.p` returns `TRUE` for at least one element in `.x`. +- `none(.x, .p)` returns `TRUE` if `.p` returns `FALSE` for all elements in `.x`. +- `head_while(.x, .p)` returns elements from the beginning of `.x` while `.p` is `TRUE`, stopping at the first `FALSE`. +- `tail_while(.x, .p)` returns elements from the end of `.x` while `.p` is `TRUE`, stopping at the first `FALSE`. You'll typically use these functions with lists, since you can usually rely on vectorization for simpler vectors.