I have used the following code to plot the results of the Tukey test after my Anova analysis in R.
TukeyHSD(myANOVA, conf.level=.90)
TUKEY <- TukeyHSD(myANOVA, conf.level=.90)
plot(TUKEY , las=1 , col="black")
However, since the number of lines plotted is too large, I would like to have the significant ones highlighted or in red. I have seen a similar question here with the comment "overwrite the black lines showing significant differences with red lines" however, I don't know how to do it.
Imagine we have the following data:
Then we conduct a Tukey test, convert the results to a matrix, and then to a dataframe (I don't know how to do it otherwise):
Then we plot it using an
ifelse
function, as a function of the p-values: