-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
featurea feature request or enhancementa feature request or enhancement
Description
Given that combine() acts like c() I don't understand why combine() (without args) does not work like c() returning NULL and raises an error instead.
If I am combining a list that may contain all NULL elements, I'd rather get back a NULL than tryCatching or checking for that condition myself in advance. It's not a big deal, but it does not seem consistent with for instance bind_rows() that returns an empty tibble.
If you agreed I'd be happy to provide a pull request.
c(1, NULL, 2)
#> [1] 1 2
dplyr::combine(1, NULL, 2)
#> [1] 1 2
c()
#> NULL
dplyr::combine(NULL)
#> Error in combine_all(args): no data to combine, all elements are NULL
c(NULL, NULL)
#> NULL
dplyr::combine(NULL, NULL)
#> Error in combine_all(args): no data to combine, all elements are NULLAs always, thanks for your time
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancement