I was too quick it seems. I think I see the problem.
When I insert print statements at the end of your program
b <- lapply(pm1, attributes)
print(b)
b1 <- b$`Pairwise p-value`$`Letter-based representation of pairwise comparisons at significant level ‘0.05’`
print(b1)
then I see that the 'pairwise' component is not present in b when knitted.
(NB I replaced the " by a back-tick because I think "should not work but apparently it does in the non-knitr version ?? )
No idea where this different behaviour comes from.
Also in interactive work the first print(b1) shows no result.
Only when I do it a second time it will show the result.
Again no idea.
The output in the console and the docx also shows
unable to evaluate scaled gradient
Model failed to converge: degenerate Hessian with 1 negative eigenvalues
but that is probably not related to the problem of not printing a result.
I said that the 'pairwise' component was not present. It is present .
I copied your statement with the definition of b1 from this page. I did not notice the 'strange' quotes around 0.05 !
When I replace the 'strange' quotes by normal quotes, the output is as expected.
The complete input with the two inserted print statements is then:
I have resolved this by extracting the output using square brackets b[[5]][5] rather than using the name with strange inverted commas.
Thanks for the help