File: modifiers.md

package info (click to toggle)
r-cran-stringr 1.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,112 kB
  • sloc: javascript: 11; sh: 9; makefile: 2
file content (39 lines) | stat: -rw-r--r-- 818 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
32
33
34
35
36
37
38
39
# patterns coerced to character

    Code
      . <- regex(x)
    Condition
      Warning in `regex()`:
      Coercing `pattern` to a plain character vector.
    Code
      . <- coll(x)
    Condition
      Warning in `coll()`:
      Coercing `pattern` to a plain character vector.
    Code
      . <- fixed(x)
    Condition
      Warning in `fixed()`:
      Coercing `pattern` to a plain character vector.

# useful error message for bad type

    Code
      type(1:3)
    Condition
      Error:
      ! `pattern` must be a character vector, not an integer vector.

# useful errors for NAs

    Code
      type(NA)
    Condition
      Error:
      ! `pattern` must be a character vector, not `NA`.
    Code
      type(c("a", "b", NA_character_, "c"))
    Condition
      Error:
      ! `pattern` can not contain NAs.