Skip to content

Commit

Permalink
In pluck(), don't replace 0-length vectors with .default (#893)
Browse files Browse the repository at this point in the history
Fixes #480
  • Loading branch information
hadley committed Aug 29, 2022
1 parent 8e10cfd commit e253446
Show file tree
Hide file tree
Showing 10 changed files with 754 additions and 409 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Expand Up @@ -30,6 +30,9 @@

## Features and fixes

* `pluck()` no longer replaces 0-length vectors with `default`; it now
only applies absent and `NULL` components.

* `lmap()` now always returns a list, even if `.x` is a data frame.
This makes it more consistent with other functions in the `map` family.

Expand Down
4 changes: 2 additions & 2 deletions R/pluck.R
Expand Up @@ -3,7 +3,7 @@
#' `pluck()` and `chuck()` implement a generalised form of `[[` that
#' allow you to index deeply and flexibly into data structures.
#' `pluck()` consistently returns `NULL` when an element does not
#' exist, `chuck()` always throws (or chucks) an error in that case.
#' exist while `chuck()` always throws (or chucks) an error.
#'
#' @param .x,x A vector or environment
#' @param ... A list of accessors for indexing into the object. Can be
Expand All @@ -15,7 +15,7 @@
#' [Dynamic dots][rlang::dyn-dots] are supported. In particular, if
#' your accessors are stored in a list, you can splice that in with
#' `!!!`.
#' @param .default Value to use if target is empty or absent.
#' @param .default Value to use if target is `NULL` or absent.
#'
#' @details
#' * You can pluck or chuck with standard accessors like integer
Expand Down
4 changes: 2 additions & 2 deletions man/pluck.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 24 additions & 41 deletions revdep/README.md
@@ -1,44 +1,27 @@
# Platform

|field |value |
|:--------|:----------------------------|
|version |R version 3.6.1 (2019-07-05) |
|os |macOS Mojave 10.14 |
|system |x86_64, darwin15.6.0 |
|ui |X11 |
|language |(EN) |
|collate |en_US.UTF-8 |
|ctype |en_US.UTF-8 |
|tz |Europe/Brussels |
|date |2019-10-16 |

# Dependencies

|package |old |new |Δ |
|:--------|:-----|:----------|:--|
|purrr |0.3.2 |0.3.2.9000 |* |
|magrittr |1.5 |1.5 | |
|rlang |0.4.0 |0.4.0 | |

# Revdeps

## Failed to check (8)

|package |version |error |warning |note |
|:----------------|:-------|:-----|:-------|:----|
|anomalyDetection |0.2.5 |1 | | |
|circumplex |0.3.3 |1 | | |
|clustermq |0.8.8 |1 | |1 |
|codemetar |0.1.8 |1 | |1 |
|colorednoise |1.0.5 |1 | | |
|ELMER |2.8.3 |1 |1 |2 |
|phenofit |0.2.5-2 |1 | | |
|TCGAbiolinks |2.12.6 |1 | |3 |

## New problems (2)

|package |version |error |warning |note |
|:--------------------------|:-------|:------|:-------|:------|
|[arrow](problems.md#arrow) |0.15.0 |-1 | |__+1__ |
|[nlrx](problems.md#nlrx) |0.3.0 |__+1__ | | |
## Failed to check (3)

|package |version |error |warning |note |
|:------------|:-------|:-----|:-------|:----|
|elbird |0.2.5 |1 | | |
|ggPMX |? | | | |
|ImputeRobust |? | | | |

## New problems (12)

|package |version |error |warning |note |
|:------------------------------------------|:-------|:------|:-------|:--------|
|[cattonum](problems.md#cattonum) |0.0.5 | | |1 __+1__ |
|[dibble](problems.md#dibble) |0.2.1 |__+1__ | | |
|[epitopR](problems.md#epitopr) |0.1.1 |__+1__ |1 |1 |
|[gghighlight](problems.md#gghighlight) |0.3.3 | |__+1__ | |
|[gratia](problems.md#gratia) |0.7.3 |__+1__ | | |
|[grizbayr](problems.md#grizbayr) |1.3.2 |__+1__ | | |
|[gwasrapidd](problems.md#gwasrapidd) |0.99.13 |__+1__ | | |
|[partialised](problems.md#partialised) |0.1.0 |__+1__ | | |
|[rATTAINS](problems.md#rattains) |0.1.3 |__+1__ |__+1__ | |
|[ruta](problems.md#ruta) |1.1.0 |__+2__ |__+1__ |1 |
|[sbm](problems.md#sbm) |0.4.4 |__+1__ | | |
|[tidywikidatar](problems.md#tidywikidatar) |0.5.4 |__+1__ | | |

56 changes: 56 additions & 0 deletions revdep/cran.md
@@ -0,0 +1,56 @@
## revdepcheck results

We checked 1345 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.

* We saw 12 new problems
* We failed to check 3 packages

Issues with CRAN packages are summarised below.

### New problems
(This reports the first line of each new failure)

* cattonum
checking R code for possible problems ... NOTE

* dibble
checking tests ... ERROR

* epitopR
checking tests ... ERROR

* gghighlight
checking re-building of vignette outputs ... WARNING

* gratia
checking tests ... ERROR

* grizbayr
checking tests ... ERROR

* gwasrapidd
checking tests ... ERROR

* partialised
checking tests ... ERROR

* rATTAINS
checking tests ... ERROR
checking re-building of vignette outputs ... WARNING

* ruta
checking examples ... ERROR
checking tests ... ERROR
checking re-building of vignette outputs ... WARNING

* sbm
checking tests ... ERROR

* tidywikidatar
checking examples ... ERROR

### Failed to check

* elbird (NA)
* ggPMX (NA)
* ImputeRobust (NA)

0 comments on commit e253446

Please sign in to comment.