Skip to content

Implement pick() and use across() output as a data frame #341

@markfairbanks

Description

@markfairbanks
library(dplyr, warn.conflicts = FALSE)

df <- tibble(x = c("a", "a", "b"), y = 1:3, z = 1:3)

df %>%
  mutate(row_sum = rowSums(across(c(y, z))))
#> # A tibble: 3 × 4
#>   x         y     z row_sum
#>   <chr> <int> <int>   <dbl>
#> 1 a         1     1       2
#> 2 a         2     2       4
#> 3 b         3     3       6

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions