Commit ec51727
committed
Have str_subset() drop NAs from string.
The "missings never match" example from ?str_subset broke in commit d681e45, which added name preservation.
The current commit keeps names while not matching NAs in string.
Also added a test for missings never to match.
> # stringr 1.5.2
> stringr::str_subset(c("a", NA, "b"), ".")
[1] "a" "b"
> # pak::pkg_install("tidyverse/stringr@d681e45")
> stringr::str_subset(c("a", NA, "b"), ".")
[1] "a" NA "b"
> stringr::str_subset(c(First = "a", Second = NA, Third = "b"), ".")
First <NA> Third
"a" NA "b"
> # Current version
> stringr::str_subset(c(First = "a", Second = NA, Third = "b"), ".")
First Third
"a" "b"1 parent 195159c commit ec51727
2 files changed
+16
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 33 | + | |
| 34 | + | |
39 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
0 commit comments