We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
tidyr_chop2()
1 parent e7aac41 commit d6bfc3bCopy full SHA for d6bfc3b
R/utils.R
@@ -130,6 +130,24 @@ tidyr_new_list <- function(x) {
130
x
131
}
132
133
+# What `vec_chop2()` would be.
134
+# Equivalent to `vec_chop(x)`, but moves names of `x` to the result.
135
+tidyr_chop2 <- function(x) {
136
+ names <- vec_names(x)
137
+
138
+ if (!is.null(names)) {
139
+ x <- vec_set_names(x, NULL)
140
+ }
141
142
+ out <- vec_chop(x)
143
144
145
+ out <- vec_set_names(out, names)
146
147
148
+ out
149
+}
150
151
apply_names_sep <- function(outer, inner, names_sep) {
152
as.character(glue("{outer}{names_sep}{inner}"))
153
0 commit comments