Skip to content

add group_modify_safely #108

@IndrajeetPatil

Description

@IndrajeetPatil

add NA for grouping level where the function fails

library(tidyverse)
df <- tibble(x1 = 1.2, x2 = 1.3, x3 = 1.4)
dplyr::bind_rows(df, df %>% mutate(across(everything(), ~ .x * NA)))
#> # A tibble: 2 x 3
#>      x1    x2    x3
#>   <dbl> <dbl> <dbl>
#> 1   1.2   1.3   1.4
#> 2  NA    NA    NA

Created on 2021-06-02 by the reprex package (v2.0.0)

Will be a general version of something like this:
https://github.com/IndrajeetPatil/ggstatsplot/blob/e8791db76f5ac705eac0a54d70897c7daa21af2f/R/helpers_ggcatstats_graphics.R#L89

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature 🔨a feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions