是否可以在R降价文档中插入R代码或变量值?我的意思是:
---
title: "Behavioural report"
author: "My name"
date: "Some date here"
output: pdf_document
---
```{r echo=FALSE}
X = 1.28473
```
Suppose that this is my R markdown document and I want to say that the value
of the variable X = {Here I want the value of X to appear}. And then blah...
所以我希望值1.28473出现在文本' X ='之后。
提前致谢!
答案 0 :(得分:2)
尝试使用以下内容代替{}
`r X`
您还可以进行内联计算:
`r mean(rnorm(50))`