thisisnic commented on a change in pull request #11690:
URL: https://github.com/apache/arrow/pull/11690#discussion_r751467899



##########
File path: r/R/dplyr-functions.R
##########
@@ -250,6 +250,27 @@ nse_funcs$is_logical <- function(x, n = NULL) {
   nse_funcs$is.logical(x)
 }
 
+# Create a data frame/tibble/struct column
+nse_funcs$tibble <- function(...) {
+  # use dots_list() because this is what tibble() uses to allow the
+  # useful shorthand of tibble(col1, col2) -> tibble(col1 = col1, col2 = col2_)
+  args <- rlang::dots_list(..., .named = TRUE)
+
+  build_expr(
+    "make_struct",
+    args = unname(args),
+    options = list(field_names = names(args))
+  )
+}
+
+nse_funcs$data.frame <- function(..., stringsAsFactors = FALSE) {

Review comment:
       I think so, yeah.  I know in the case of some functions we just leave 
the arguments out and it pushes it down the the R level, but I guess that only 
works when there is no `...` argument.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to