Skip to content

Can't pass additional arguments to group_modify() function #4509

Description

@earcanal

I have some code which seems to have broken since group_map() became group_modify(). Converting to group_modify() only partially resolves this as my function also requires additional arguments. Under the old group_map() my function received args passed in ..., but I get an error for the same function under the new group_modify().

The docs indicate I should be able to do this:

... Additional arguments passed on to .f

Is this a regression, or am I doing something wrong?

# dplyr_0.8.3
library(tidyverse)

m <- function(x, y, a, b) {
  tibble(z = z)  
}

mtcars %>%
  group_by(cyl) %>%
  group_modify(m, 1, 2) %>%
  ungroup

Error in (function (.x, .y)  : unused arguments (1, 2)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions