File: eval-bool.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 (31 lines) | stat: -rw-r--r-- 908 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
27
28
29
30
31
# boolean operators throw relevant errors

    Code
      # Unknown names
      select_loc(mtcars, foobar & contains("am"))
    Condition
      Error in `select_loc()`:
      ! Can't subset columns that don't exist.
      x Column `foobar` doesn't exist.
    Code
      select_loc(mtcars, contains("am") | foobar)
    Condition
      Error in `select_loc()`:
      ! Can't subset columns that don't exist.
      x Column `foobar` doesn't exist.
    Code
      # Empty intersection
      select_loc(mtcars, cyl & am)
    Condition
      Error in `select_loc()`:
      ! Can't take the intersection of two columns.
      i `cyl & am` is always an empty selection.
    Code
      # Symbol operands are evaluated in strict mode
      foo <- 1:2
      select_loc(iris, Species | foo)
    Condition
      Error in `select_loc()`:
      ! Can't subset columns that don't exist.
      x Column `foo` doesn't exist.