Вот мой кусок кода:
<<>>=
x <- 500
y <- 6
result <- (x/y)
print(result)
@
И этот текст, который я хочу создать в любом месте PDF-файла, выглядит примерно так:
The result of x divided by y is 83.33333
Я пытался добиться этого в текстовый режим следующим образом:
The result of x divided by y is `result`
Но значение не генерируется в файле PDF. Снимок экрана с моей страницей в формате PDF:
![enter image description here](https://i.stack.imgur.com/107FP.jpg)
Все коды файла .Rnw для создания этого PDF:
\documentclass{article}
\begin{document}
\title{Test Document}
%\subtitle{testing}
\author{Test}
\date{}
\maketitle
\section{Introduction}
We will pass value of our variable to the text mode
<<>>=
x <- 500
y <- 6
result <- (x/y)
print(result)
@
This is just a simple math operation. We'll go to deep later. In the example, The result of x divided by y is `result`
\end{document}