Skip to content

Commit

Permalink
fix: Cannot name NULL values
Browse files Browse the repository at this point in the history
  • Loading branch information
nathaneastwood committed Oct 22, 2023
1 parent 3cc0a99 commit 48c9ae3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions R/mutate.R
Expand Up @@ -161,8 +161,7 @@ mutate_df <- function(.data, ...) {
cond_nms[i] <- names(conditions)[[i]]
context$.data[[cond_nms[i]]] <- res
} else {
if (is.null(res_nms)) names(res) <- names(conditions)[[i]]
context$.data[[names(res)]] <- res
context$.data[[names(conditions)[[i]]]] <- res
}
}
list(
Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/test_mutate.R
Expand Up @@ -217,7 +217,7 @@ expect_equal(
models <- mtcars %>% nest_by(cyl) %>% mutate(model = list(lm(mpg ~ wt, data = data)))
expect_equal(
lapply(models$model, class),
list(model = "lm", model = "lm", model = "lm"),
list("lm", "lm", "lm"),
info = "List columns can be mutated: 3"
)

Expand Down

0 comments on commit 48c9ae3

Please sign in to comment.