File: helpers-where.md

package info (click to toggle)
r-cran-tidyselect 1.2.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 616 kB
  • sloc: sh: 13; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 590 bytes parent folder | download
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
# where() checks return values

    Code
      where(NA)
    Condition
      Error in `where()`:
      ! Can't convert `fn`, `NA`, to a function.

---

    Code
      select_loc(iris, where(~NA))
    Condition
      Error in `where()`:
      ! Predicate must return `TRUE` or `FALSE`, not `NA`.
    Code
      select_loc(iris, where(~1))
    Condition
      Error in `where()`:
      ! Predicate must return `TRUE` or `FALSE`, not a number.
    Code
      select_loc(iris, where(mean))
    Condition
      Error in `where()`:
      ! Predicate must return `TRUE` or `FALSE`, not a number.