Possible duplicate:
Adding Line Breaks to Code Blocks in R Markdown
Is there any option in knitr for storing strings in R code? After compiling the document, the code should be displayed, as in the following example:
\documentclass[a4paper]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \begin{document} <<hist>>= df <- data.frame(x=rnorm(100,100,20)) library(lattice) histogram(~x, df, main="histogram", nint=20) @ \end{document}
Thank you for your help!
r knitr latex
beginneR
source share