|
5 | 5 | Output |
6 | 6 | <error/vctrs_error_subscript_type> |
7 | 7 | Error in `vec_slice()`: |
8 | | - ! Must subset elements with a valid subscript vector. |
| 8 | + ! Can't subset elements with `i`. |
9 | 9 | x `i` must be logical, numeric, or character, not a <Date> object. |
10 | 10 | Code |
11 | 11 | (expect_error(vec_slice(1:3, matrix(TRUE, nrow = 1)), class = "vctrs_error_subscript_type") |
12 | 12 | ) |
13 | 13 | Output |
14 | 14 | <error/vctrs_error_subscript_type> |
15 | 15 | Error in `vec_slice()`: |
16 | | - ! Must subset elements with a valid subscript vector. |
| 16 | + ! Can't subset elements with `i`. |
17 | 17 | x Subscript `i` must be a simple vector, not a matrix. |
18 | 18 |
|
19 | 19 | # can't index beyond the end of a vector |
|
42 | 42 | Output |
43 | 43 | <error/vctrs_error_subscript_type> |
44 | 44 | Error: |
45 | | - ! Must subset elements with a valid subscript vector. |
| 45 | + ! Can't subset elements with `2^31`. |
46 | 46 | x Can't convert from `2^31` <double> to <integer> due to loss of precision. |
47 | 47 |
|
48 | 48 | # Unnamed vector with character subscript is caught |
|
59 | 59 | vec_slice(1:3, -c(1L, NA)) |
60 | 60 | Condition |
61 | 61 | Error in `vec_slice()`: |
62 | | - ! Must subset elements with a valid subscript vector. |
| 62 | + ! Can't subset elements with `i`. |
63 | 63 | x Negative locations can't have missing values. |
64 | 64 | i Subscript `i` has a missing value at location 2. |
65 | 65 |
|
|
69 | 69 | vec_slice(1:3, c(-1L, 1L)) |
70 | 70 | Condition |
71 | 71 | Error in `vec_slice()`: |
72 | | - ! Must subset elements with a valid subscript vector. |
| 72 | + ! Can't subset elements with `i`. |
73 | 73 | x Negative and positive locations can't be mixed. |
74 | 74 | i Subscript `i` has a positive value at location 2. |
75 | 75 |
|
|
0 commit comments