Commits


Dewey Dunnington authored and Jonathan Keane committed 3668b572ddd
ARROW-13371 [R] binding for make_struct -> StructArray$create() This PR implements a binding for the `make_struct` compute function. This function was already being called in the translation for `case_when()` but didn't have a binding of its own. Because you can do this in dplyr too (create a nested data frame), I mapped `tibble()` and `data.frame()` since it can be tested using `compare_dplyr_binding()`. `StructArray$create()` is a nested call and is probably not that useful of a translation for dplyr users (I'd never think to use it). Basically, you can now do this: ``` r library(arrow, warn.conflicts = FALSE) library(dplyr, warn.conflicts = FALSE) df <- RecordBatch$create(a = 1, b = "two") df %>% mutate(df_col = tibble(a, b)) %>% collect() #> # A tibble: 1 × 3 #> a b df_col$a $b #> <dbl> <chr> <dbl> <chr> #> 1 1 two 1 two ``` Something I didn't do but could is add all the arguments of `tibble()` and `data.frame()` that aren't supported (e.g., `stringsAsFactors`). It seems like this is done for other translations but I just wanted to check! Closes #11690 from paleolimbot/r-make-struct Authored-by: Dewey Dunnington <dewey@fishandwhistle.net> Signed-off-by: Jonathan Keane <jkeane@gmail.com>