'Remove trendline from ANCOVA plot in ggplot

I am doing a one-way ANCOVA analysis on root colonisation data using the following example https://www.datanovia.com/en/lessons/ancova-in-r/. I am trying to remove the trendline from the resulting plot as my treatments are separate groups so I don't think it is necessary. I have tried using each of the following but I can't get any to work with this code. Is there another way I can go about this? Thanks!

+geom_line(linetype = “blank”)
color = "white"
plot_type = c("p")
library(tidyverse)
library(ggpubr)
library(rstatix)
library(broom)
library(emmeans)

data("anxiety", package = "datarium")

anxiety <- anxiety %>%
  select(id, group, t1, t3) %>%
  rename(pretest = t1, posttest = t3)
anxiety[14, "posttest"] <- 19

anxiety %>% anova_test(posttest ~ group*pretest)
res.aov <- anxiety %>% anova_test(posttest ~ pretest + group)
pwc <- anxiety %>% 
  emmeans_test(
    posttest ~ group, covariate = pretest,
    p.adjust.method = "bonferroni"
    )
pwc
get_emmeans(pwc)
pwc <- pwc %>% add_xy_position(x = "group", fun = "mean_se")

ggline(get_emmeans(pwc), x = "group", y = "emmean") +
  geom_errorbar(aes(ymin = conf.low, ymax = conf.high), width = 0.2) + 
  stat_pvalue_manual(pwc, hide.ns = TRUE, tip.length = FALSE) +
  labs(
    subtitle = get_test_label(res.aov, detailed = TRUE),
    caption = get_pwc_label(pwc)
  )

ggline plot showing ANCOVA results

r


Sources

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

Source: Stack Overflow

Solution Source