Open TimTeaFan opened 1 year ago
.comb = "minimal" is not working if we use NULL inside .fns.
.comb = "minimal"
NULL
.fns
library(tidyverse) library(dplyover) df <- tibble(V1 = sample(c(0,1), 25, replace=TRUE, prob=c(0.6, 0.4)), V2 = sample(c(0,1), 25, replace=TRUE, prob=c(0.6, 0.4)), V3 = sample(c(0,1), 25, replace=TRUE, prob=c(0.8, 0.2)), V4 = sample(c(0,1), 25, replace=TRUE, prob=c(0.7, 0.3)), V5 = sample(c(0,1), 25, replace=TRUE, prob=c(0.8, 0.2)), V6 = sample(c(0,1), 25, replace=TRUE, prob=c(0.8, 0.2)), V7 = sample(c(0,1), 25, replace=TRUE, prob=c(0.8, 0.2))) df %>% mutate(across2x(everything(), everything(), ~ { check <- .x * .y if (!any(check)) { NULL } else { ifelse(check, 1, 0 ) } }, .comb = "minimal" ) ) #> Error in `mutate_cols()`: #> ! Problem with `mutate()` input `..1`. #> i `..1 = across2x(...)`. #> x Attribut 'names' [49] muss dieselbe Länge haben wie der Vektor [42] #> Caused by error in `names(out) <- names`: #> ! Attribut 'names' [49] muss dieselbe Länge haben wie der Vektor [42]
Created on 2023-01-24 by the reprex package (v2.0.1)
.comb = "minimal"
is not working if we useNULL
inside.fns
.Created on 2023-01-24 by the reprex package (v2.0.1)