Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. writeLines('
  2. <<echo=FALSE, results="asis">>=
  3. writeLines("Hello World!")
  4. @
  5. ', "foo.Rnw")
  6.  
  7. knitr::knit("foo.Rnw", quiet = TRUE)
  8. writeLines(readLines("foo.tex"))
  9. ##
  10. ## Hello World!
  11. ##
  12.  
  13. knitr::render_sweave()
  14. knitr::knit("foo.Rnw", quiet = TRUE)
  15. writeLines(readLines("foo.tex"))
  16. ##
  17. ## begin{Soutput}
  18. ## Hello World!
  19. ## end{Soutput}
  20. ##
  21.  
  22. writeLines('
  23. <<echo=FALSE, results=tex>>=
  24. writeLines("Hello World!")
  25. @
  26. ', "foo.Rnw")
  27.  
  28. utils::Sweave("foo.Rnw", quiet = TRUE)
  29. writeLines(readLines("foo.tex"))
  30. ##
  31. ## Hello World!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement