Hi, it'd be great if, instead of stopping the stat calculation with one of the variables that has no enough observations, just leave an NA and continue with the other variables.
If I try to calculate any test (eg, Wilcox), I get this error because MDSC has no observations in condition a and BL...
> mydata %>% group_by(pops, condition) %>% rstatix::wilcox_test(value ~ timepoint)
Error in `mutate()`:
ℹ In argument: `data = map(.data$data, .f, ...)`.
Caused by error in `map()`:
ℹ In index: 2.
Caused by error in `wilcox.test.default()`:
! not enough 'y' observations
Run `rlang::last_trace()` to see where the error occurred.
> mydata %>% group_by(pops, condition) %$% table(pops, timepoint, condition)
, , condition = a
timepoint
pops BL ES
MEP 7 5
MDSC 0 2
, , condition = b
timepoint
pops BL ES
MEP 5 5
MDSC 2 3
... I have to manually remove this variable and then it works:
> mydata %>% subset(pops != "MDSC") %>% group_by(pops, condition) %>% rstatix::wilcox_test(value ~ timepoint)
# A tibble: 2 × 9
pops condition .y. group1 group2 n1 n2 statistic p
* <fct> <chr> <chr> <chr> <chr> <int> <int> <dbl> <dbl>
1 MEP a value BL ES 7 5 16 0.876
2 MEP b value BL ES 5 5 15 0.69
It'd be nice just to have something like this and not stopping the calculation:
Warning: Some variables do not have enough observations for calculation.
# A tibble: 2 × 9
pops condition .y. group1 group2 n1 n2 statistic p
* <fct> <chr> <chr> <chr> <chr> <int> <int> <dbl> <dbl>
1 MDSC a value BL ES 0 2 <NA> <NA>
2 MDSC b value BL ES 2 3 ... ...
3 MEP a value BL ES 7 5 16 0.876
4 MEP b value BL ES 5 5 15 0.69
Hi, it'd be great if, instead of stopping the stat calculation with one of the variables that has no enough observations, just leave an NA and continue with the other variables.
For example, this is my data:
If I try to calculate any test (eg, Wilcox), I get this error because MDSC has no observations in condition a and BL...
... I have to manually remove this variable and then it works:
It'd be nice just to have something like this and not stopping the calculation:
Only as a suggestion. Thanks!