'non-numeric argument to binary operator error in R: error in ANOVA visualization [closed]

I am getting this error when trying to visualize repeated measure ANOVA scores via ggpubr. I follow the exact same steps from this website neither my own ANOVA model nor the website's model work for visualization, getting the same error. I've noticed that the author of the blog who is also the owner of the ggpubr's recommended updating the ggpubr to someone who had the same problem. however, it's not solving the problem.

I also tried to use a different version of R then installed 4.00 unfortunately, the problem is still going on even though on a different pc.

install.packages("datarium")
data("selfesteem", package = "datarium")
selfesteem <- selfesteem %>%
  gather(key = "time", value = "score", t1, t2, t3) %>%
  convert_as_factor(id, time)
res.aov <- anova_test(data = selfesteem, dv = score, wid = id, within = time)
get_anova_table(res.aov)
pwc <- selfesteem %>%
  pairwise_t_test(
    score ~ time, paired = TRUE,
    p.adjust.method = "bonferroni"
  )

    

#the error is starting with the following code

pwc <- pwc %>% add_xy_position(x = "time")
bxp + 
  stat_pvalue_manual(pwc) +
  labs(
    subtitle = get_test_label(res.aov, detailed = TRUE),
    caption = get_pwc_label(pwc)
  )
Error in bxp + stat_pvalue_manual(pwc) + labs(subtitle = get_test_label(res.aov,  :    non-numeric argument to binary operator


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source