【发布时间】:2017-08-04 00:59:20
【问题描述】:
我想在 knitr LaTeX 文档 (.Rnw) 中打印几句话,但前提是存在某些数据。这些句子大多是文本,但也有一些 R。
例子:
A chi-squared test of your observed sizes has a p-value of
\Sexpr{format(calculated_chisq$p.value,digits=3,scientific=F)}.
A p-value below 0.05 means you should be concerned that your
groups are broken. The lower the p-value, the more worried you
should be.
我用results='asis' 尝试了一个块,但我认为该块被解释为 R。
我用 R 尝试了 print() 和 paste()。它很难看,但它有效。但是,它会在其中添加似乎与 R 提示符相对应的额外文本。
有什么好的方法吗?
【问题讨论】: