Skip to content

Error in across #7041

@Unaimend

Description

@Unaimend
data(iris)
iris %>%
  group_by(Species) %>%
  summarise(across(starts_with("Sepal"), ~ mean(.x, na.rm = TRUE)))

Results in following error
Error in across(): ! Must only be used inside data-masking verbs like mutate(), filter(), and group_by(). Run rlang::last_trace()to see where the error occurred. (ins)>

The code was copied from the documentation
https://dplyr.tidyverse.org/reference/across.html#:~:text=across()%20makes%20it%20easy,colwise%22)%20for%20more%20details.

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