Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# tidyr (development version)

* Docs for `expand_grid` now include an example using a named list and the splice operator, a common use case.

* `fill()` gains a `.by` argument as an alternative to `dplyr::group_by()` for
applying the fill per group, similar to `nest(.by =)` and
`dplyr::mutate(.by =)` (@olivroy, #1439).
Expand Down
4 changes: 4 additions & 0 deletions R/expand.R
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ nesting <- function(..., .name_repair = "check_unique") {
#'
#' # And matrices
#' expand_grid(x1 = matrix(1:4, nrow = 2), x2 = matrix(5:8, nrow = 2))
#'
#' # And named lists using the splice operator
#' my_params <- list(a = 1:3, b = c("a", "b", "c", "d"))
#' expand_grid(!!!my_params)
expand_grid <- function(..., .name_repair = "check_unique", .vary = "slowest") {
out <- grid_dots(...)

Expand Down
Loading