|
23 | 23 | Output |
24 | 24 | <error/vctrs_error_subscript_oob> |
25 | 25 | Error in `vec_slice()`: |
26 | | - ! Can't subset elements past the end. |
| 26 | + ! Can't subset elements with `i`. |
27 | 27 | x Location must be less than or equal to 2, not 3. |
28 | 28 | i There are only 2 elements. |
29 | 29 | Code |
30 | 30 | (expect_error(vec_slice(1:2, -3L), class = "vctrs_error_subscript_oob")) |
31 | 31 | Output |
32 | 32 | <error/vctrs_error_subscript_oob> |
33 | 33 | Error in `vec_slice()`: |
34 | | - ! Can't negate elements past the end. |
| 34 | + ! Can't negate elements with `i`. |
35 | 35 | x Location must be less than or equal to 2, not 3. |
36 | 36 | i There are only 2 elements. |
37 | 37 |
|
|
79 | 79 | vec_slice(c(bar = 1), "foo") |
80 | 80 | Condition |
81 | 81 | Error in `vec_slice()`: |
82 | | - ! Can't subset elements that don't exist. |
| 82 | + ! Can't subset elements with `i`. |
83 | 83 | x Element `foo` doesn't exist. |
84 | 84 |
|
85 | 85 | --- |
|
88 | 88 | vec_slice(letters, c(100, 1000)) |
89 | 89 | Condition |
90 | 90 | Error in `vec_slice()`: |
91 | | - ! Can't subset elements past the end. |
| 91 | + ! Can't subset elements with `i`. |
92 | 92 | x Locations must be less than or equal to 26. |
93 | 93 | i There are only 26 elements. |
94 | 94 |
|
|
98 | 98 | vec_slice(letters, c(1, 100:103, 2, 104:110)) |
99 | 99 | Condition |
100 | 100 | Error in `vec_slice()`: |
101 | | - ! Can't subset elements past the end. |
| 101 | + ! Can't subset elements with `i`. |
102 | 102 | x Locations must be less than or equal to 26. |
103 | 103 | i There are only 26 elements. |
104 | 104 |
|
|
108 | 108 | vec_slice(set_names(letters), c("foo", "bar")) |
109 | 109 | Condition |
110 | 110 | Error in `vec_slice()`: |
111 | | - ! Can't subset elements that don't exist. |
| 111 | + ! Can't subset elements with `i`. |
112 | 112 | x Elements `foo` and `bar` don't exist. |
113 | 113 |
|
114 | 114 | --- |
|
117 | 117 | vec_slice(set_names(letters), toupper(letters)) |
118 | 118 | Condition |
119 | 119 | Error in `vec_slice()`: |
120 | | - ! Can't subset elements that don't exist. |
| 120 | + ! Can't subset elements with `i`. |
121 | 121 | x Elements `A`, `B`, `C`, `D`, `E`, etc. don't exist. |
122 | 122 |
|
123 | 123 | # vec_init() validates `n` |
|
0 commit comments