I have an object one
that contains the results of a kruskal-wallis test. The p-value is really tiny i.e. 6.86e-09. Is there a way in inline code in R markdown to say p < 0.0001 instead of writing the exact p-value?
one <- kruskal.test(Petal.Width ~ Species, data = iris)
I have tried:
There was a statistically significant difference in the Petal Width between species
H(`r one[[2]]`) = `r round(one[[1]], 3)`, *p* = `r round(one[[3]], 11)`.
And:
`r if(one[[3]] < 0.0001){ print("< 0.0001") } else { round(one[[3]], 4) }`
Desired output:
There was a statistically significant difference in the Petal Width between species H(2) = 131.19, p < 0.0001.
There are lot's out there on how to recode into significance codes etc, but not really how to do this for inline code. I am new to this so any help is appreciated!