|
1 | | -# as_tibble() implements unique names |
| 1 | +# output test |
2 | 2 |
|
3 | 3 | Code |
4 | | - invalid_df <- as_tibble(list(3, 4, 5), .name_repair = "unique") |
5 | | - Message <rlib_message_name_repair> |
6 | | - New names: |
7 | | - * `` -> `...1` |
8 | | - * `` -> `...2` |
9 | | - * `` -> `...3` |
10 | | - |
11 | | -# as_tibble() implements universal names |
12 | | - |
| 4 | + as_tibble(list(1)) |
| 5 | + Condition |
| 6 | + Error: |
| 7 | + ! Column 1 must be named. |
| 8 | + Use .name_repair to specify repair. |
| 9 | + Caused by error in `stop_vctrs()`: |
| 10 | + ! Names can't be empty. |
| 11 | + x Empty name found at location 1. |
13 | 12 | Code |
14 | | - invalid_df <- as_tibble(list(3, 4, 5), .name_repair = "universal") |
15 | | - Message <rlib_message_name_repair> |
16 | | - New names: |
17 | | - * `` -> `...1` |
18 | | - * `` -> `...2` |
19 | | - * `` -> `...3` |
20 | | - |
21 | | -# as_tibble.matrix() supports .name_repair |
22 | | - |
| 13 | + as_tibble(list(1, 2)) |
| 14 | + Condition |
| 15 | + Error: |
| 16 | + ! Columns 1 and 2 must be named. |
| 17 | + Use .name_repair to specify repair. |
| 18 | + Caused by error in `stop_vctrs()`: |
| 19 | + ! Names can't be empty. |
| 20 | + x Empty names found at locations 1 and 2. |
23 | 21 | Code |
24 | | - universal <- as_tibble(x, .name_repair = "universal") |
25 | | - Message <rlib_message_name_repair> |
26 | | - New names: |
27 | | - * `` -> `...1` |
28 | | - * `` -> `...2` |
29 | | - |
30 | | ---- |
31 | | - |
| 22 | + as_tibble(list(a = 1, 2)) |
| 23 | + Condition |
| 24 | + Error: |
| 25 | + ! Column 2 must be named. |
| 26 | + Use .name_repair to specify repair. |
| 27 | + Caused by error in `stop_vctrs()`: |
| 28 | + ! Names can't be empty. |
| 29 | + x Empty name found at location 2. |
32 | 30 | Code |
33 | | - universal <- as_tibble(x, .name_repair = "universal") |
34 | | - Message <rlib_message_name_repair> |
35 | | - New names: |
36 | | - * `if` -> `.if` |
37 | | - |
38 | | -# as_tibble.poly() supports .name_repair |
39 | | - |
| 31 | + as_tibble(as.list(1:26)) |
| 32 | + Condition |
| 33 | + Error: |
| 34 | + ! Columns 1, 2, 3, 4, 5, and 21 more must be named. |
| 35 | + Use .name_repair to specify repair. |
| 36 | + Caused by error in `stop_vctrs()`: |
| 37 | + ! Names can't be empty. |
| 38 | + x Empty names found at locations 1, 2, 3, 4, 5, etc. |
40 | 39 | Code |
41 | | - universal <- as_tibble(x, .name_repair = "universal") |
42 | | - Message <rlib_message_name_repair> |
43 | | - New names: |
44 | | - * `1` -> `...1` |
45 | | - * `2` -> `...2` |
46 | | - * `3` -> `...3` |
47 | | - |
48 | | -# as_tibble.table() supports .name_repair |
49 | | - |
| 40 | + as_tibble(set_names(list(1), "..1")) |
| 41 | + Condition |
| 42 | + Error: |
| 43 | + ! Column 1 must not have names of the form ... or ..j. |
| 44 | + Use .name_repair to specify repair. |
| 45 | + Caused by error in `stop_vctrs()`: |
| 46 | + ! Names can't be of the form `...` or `..j`. |
| 47 | + x These names are invalid: |
| 48 | + * "..1" at location 1. |
| 49 | + Code |
| 50 | + as_tibble(set_names(list(1:26), paste0("..", 1:26))) |
| 51 | + Condition |
| 52 | + Error in `set_names()`: |
| 53 | + ! The size of `nm` (26) must be compatible with the size of `x` (1). |
| 54 | + Code |
| 55 | + as_tibble(list(a = 1, a = 1)) |
| 56 | + Condition |
| 57 | + Error: |
| 58 | + ! Column name `a` must not be duplicated. |
| 59 | + Use .name_repair to specify repair. |
| 60 | + Caused by error in `stop_vctrs()`: |
| 61 | + ! Names must be unique. |
| 62 | + x These names are duplicated: |
| 63 | + * "a" at locations 1 and 2. |
50 | 64 | Code |
51 | | - as_tibble(table(a = c(1, 1, 1, 2, 2, 2), a = c(3, 4, 5, 3, 4, 5))) |
52 | | - Error <tibble_error_column_names_must_be_unique> |
53 | | - Column name `a` must not be duplicated. |
| 65 | + as_tibble(list(a = 1, a = 1, b = 1, b = 1)) |
| 66 | + Condition |
| 67 | + Error: |
| 68 | + ! Column names `a` and `b` must not be duplicated. |
54 | 69 | Use .name_repair to specify repair. |
55 | 70 | Caused by error in `stop_vctrs()`: |
56 | 71 | ! Names must be unique. |
57 | 72 | x These names are duplicated: |
58 | 73 | * "a" at locations 1 and 2. |
| 74 | + * "b" at locations 3 and 4. |
59 | 75 | Code |
60 | | - as_tibble(table(c(1, 1, 1, 2, 2, 2), c(3, 4, 5, 3, 4, 5))) |
61 | | - Error <tibble_error_column_names_cannot_be_empty> |
62 | | - Columns 1 and 2 must be named. |
| 76 | + as_tibble(list(a = new_environment())) |
| 77 | + Condition |
| 78 | + Error: |
| 79 | + ! All columns in a tibble must be vectors. |
| 80 | + x Column `a` is an environment. |
| 81 | + Code |
| 82 | + as_tibble_row(list(1)) |
| 83 | + Condition |
| 84 | + Error: |
| 85 | + ! Column 1 must be named. |
| 86 | + Use .name_repair to specify repair. |
| 87 | + Caused by error in `stop_vctrs()`: |
| 88 | + ! Names can't be empty. |
| 89 | + x Empty name found at location 1. |
| 90 | + Code |
| 91 | + as_tibble_row(list(1, 2)) |
| 92 | + Condition |
| 93 | + Error: |
| 94 | + ! Columns 1 and 2 must be named. |
63 | 95 | Use .name_repair to specify repair. |
64 | 96 | Caused by error in `stop_vctrs()`: |
65 | 97 | ! Names can't be empty. |
66 | 98 | x Empty names found at locations 1 and 2. |
67 | | - |
68 | | ---- |
69 | | - |
70 | 99 | Code |
71 | | - universal <- as_tibble(x, .name_repair = "universal") |
72 | | - Message <rlib_message_name_repair> |
73 | | - New names: |
74 | | - * `a` -> `a...1` |
75 | | - * `a` -> `a...2` |
76 | | - |
77 | | ---- |
78 | | - |
| 100 | + as_tibble_row(list(a = 1, 2)) |
| 101 | + Condition |
| 102 | + Error: |
| 103 | + ! Column 2 must be named. |
| 104 | + Use .name_repair to specify repair. |
| 105 | + Caused by error in `stop_vctrs()`: |
| 106 | + ! Names can't be empty. |
| 107 | + x Empty name found at location 2. |
79 | 108 | Code |
80 | | - universal <- as_tibble(x, .name_repair = "universal") |
81 | | - Message <rlib_message_name_repair> |
82 | | - New names: |
83 | | - * `if` -> `.if` |
84 | | - |
85 | | ---- |
86 | | - |
| 109 | + as_tibble_row(as.list(1:26)) |
| 110 | + Condition |
| 111 | + Error: |
| 112 | + ! Columns 1, 2, 3, 4, 5, and 21 more must be named. |
| 113 | + Use .name_repair to specify repair. |
| 114 | + Caused by error in `stop_vctrs()`: |
| 115 | + ! Names can't be empty. |
| 116 | + x Empty names found at locations 1, 2, 3, 4, 5, etc. |
87 | 117 | Code |
88 | | - universal <- as_tibble(x, .name_repair = "universal") |
89 | | - Message <rlib_message_name_repair> |
90 | | - New names: |
91 | | - * `n` -> `n...2` |
92 | | - * `n` -> `n...3` |
93 | | - |
94 | | -# as_tibble.ts() supports .name_repair, minimal by default (#537) |
95 | | - |
| 118 | + as_tibble_row(set_names(list(1), "..1")) |
| 119 | + Condition |
| 120 | + Error: |
| 121 | + ! Column 1 must not have names of the form ... or ..j. |
| 122 | + Use .name_repair to specify repair. |
| 123 | + Caused by error in `stop_vctrs()`: |
| 124 | + ! Names can't be of the form `...` or `..j`. |
| 125 | + x These names are invalid: |
| 126 | + * "..1" at location 1. |
96 | 127 | Code |
97 | | - universal <- as_tibble(x, .name_repair = "universal") |
98 | | - Message <rlib_message_name_repair> |
99 | | - New names: |
100 | | - * `` -> `...1` |
101 | | - * `` -> `...2` |
102 | | - |
103 | | ---- |
104 | | - |
| 128 | + as_tibble_row(set_names(list(1:26), paste0("..", 1:26))) |
| 129 | + Condition |
| 130 | + Error in `set_names()`: |
| 131 | + ! The size of `nm` (26) must be compatible with the size of `x` (1). |
105 | 132 | Code |
106 | | - universal <- as_tibble(x, .name_repair = "universal") |
107 | | - Message <rlib_message_name_repair> |
108 | | - New names: |
109 | | - * `if` -> `.if` |
110 | | - |
111 | | -# creates col names with name repair |
112 | | - |
| 133 | + as_tibble_row(list(a = 1, a = 1)) |
| 134 | + Condition |
| 135 | + Error: |
| 136 | + ! Column name `a` must not be duplicated. |
| 137 | + Use .name_repair to specify repair. |
| 138 | + Caused by error in `stop_vctrs()`: |
| 139 | + ! Names must be unique. |
| 140 | + x These names are duplicated: |
| 141 | + * "a" at locations 1 and 2. |
113 | 142 | Code |
114 | | - out <- as_tibble(x, .name_repair = "unique") |
115 | | - Message <rlib_message_name_repair> |
116 | | - New names: |
117 | | - * `` -> `...1` |
118 | | - * `` -> `...2` |
119 | | - |
120 | | ---- |
121 | | - |
| 143 | + as_tibble_row(list(a = 1, a = 1, b = 1, b = 1)) |
| 144 | + Condition |
| 145 | + Error: |
| 146 | + ! Column names `a` and `b` must not be duplicated. |
| 147 | + Use .name_repair to specify repair. |
| 148 | + Caused by error in `stop_vctrs()`: |
| 149 | + ! Names must be unique. |
| 150 | + x These names are duplicated: |
| 151 | + * "a" at locations 1 and 2. |
| 152 | + * "b" at locations 3 and 4. |
| 153 | + Code |
| 154 | + as_tibble_row(list(a = new_environment())) |
| 155 | + Condition |
| 156 | + Error in `stop_vctrs()`: |
| 157 | + ! Input must be a vector, not an environment. |
| 158 | + Code |
| 159 | + as_tibble_row(list(a = 1:3)) |
| 160 | + Condition |
| 161 | + Error: |
| 162 | + ! All elements must be size one, use `list()` to wrap. |
| 163 | + x Element `a` is of size 3. |
122 | 164 | Code |
123 | | - out <- as_tibble(x, .name_repair = "universal") |
124 | | - Message <rlib_message_name_repair> |
125 | | - New names: |
126 | | - * `` -> `...1` |
127 | | - * `` -> `...2` |
| 165 | + as_tibble_row(list(a = 1:3, b = 1:3)) |
| 166 | + Condition |
| 167 | + Error: |
| 168 | + ! All elements must be size one, use `list()` to wrap. |
| 169 | + x Element `a` is of size 3. |
| 170 | + x Element `b` is of size 3. |
128 | 171 |
|
0 commit comments