0

Im trying to do find the Estimated Marginal Means of some data but keep getting an error message.

# Pairwise comparisons
library(emmeans)

pwc <- df1 %>%  emmeans_test(Y ~ C, covariate = M,
    p.adjust.method = "bonferroni")

returns

> # Pairwise comparisons
> library(emmeans)
> pwc <- df1 %>% 
+   emmeans_test(
+     Y ~ C, covariate = M,
+     p.adjust.method = "bonferroni"
+   )
Error: Column name `std.error` must not be duplicated.
Run `rlang::last_error()` to see where the error occurred.

yet there is no duplicated column. None of my columns are named std.error enter image description here

checking for errors shows this

█
├─<error/tibble_error_column_names_must_be_unique>
│ Column name `std.error` must not be duplicated.
└─<error/vctrs_error_names_must_be_unique>
  Names must be unique.
Backtrace:
  1. df1 %>% emmeans_test(Y ~ C, covariate = M, p.adjust.method = "bonferroni")
  5. tibble::add_column(., std.error = std.error, .after = "estimate")
  6. tibble:::set_repaired_names(out, .name_repair)
  8. tibble:::repaired_names(...)
 11. vctrs::vec_as_names(...)
 13. vctrs:::validate_unique(names = names, arg = arg)
 14. vctrs:::stop_names_must_be_unique(names, arg)
 15. vctrs:::stop_names(...)
 16. vctrs:::stop_vctrs(class = c(class, "vctrs_error_names"), ...)
Run `rlang::last_trace()` to see the full context.
Phil
  • 7,287
  • 3
  • 36
  • 66
  • Did you create the `emmeans_test` function? It's not available in the `emmans` package. – Phil Feb 25 '21 at 15:06
  • 'emmeans_test' is part of the 'rstatix' package. I have just found that there was an error with the release of this package and my problems are stemming from that. An updated package has been released that should solve my problem: found here (https://github.com/kassambara/rstatix/issues/89) – Zzzr124 Feb 25 '21 at 15:30

0 Answers0