I'm relatively new to Knitr. I want to run a function just once, so that next time I don't have to evaluate it, because it would yield a different result. My MWE:
First time:
\documentclass{article}
\begin{document}
<<>>=
a<<-Sys.time()
@
<<>>=
a
@
\end{document}
Second time:
\documentclass{article}
\begin{document}
<<eval=FALSE>>=
a<-Sys.time()
@
<<>>=
a
@
\end{document}
I've tried using <<-
so that the variable is stored in the global environment but it doesn't work.