在编织R markdown文档时,按原样打印内联代码,例如:
- The number of patients in the dataframe is `n_distinct(med1$patients)`.
编织完全相同:
- 数据框中的患者人数为
n_distinct(med1$patients)
。
不评估代码,而是将文本格式化为代码。在上一个问题中,有人建议添加方括号,但这对我不起作用。 任何建议将不胜感激。
答案 0 :(得分:1)
我偶然发现了解决方案。我不得不这样写:
- 数据框中的患者数量为r n_distinct(med1 $ Patients)。
在代码中加上额外的R使其可以按预期运行。