2

Is there a straightforward way for getting the RPubs back to Rmd file for easier R workflow? There is great explanation for knitr knit2html HERE

striatum
  • 1,428
  • 3
  • 14
  • 31
  • 1
    You could, using Pandoc, convert HTML back to markdown and get an `.md` file. But you can't tell what R code was to get a certain result, so you can't go from `.md` back to `.Rmd`. – Gregor Thomas Nov 17 '20 at 20:40
  • HTML files often have just results from evaluating code, not the code itself. You can't tell what R code I just ran to get the result `6`. Maybe it was `mean(c(5, 7))`. Maybe `mean(c(4, 6, 8))`. Maybe it was `sample(1:10, size = 1)`... – Gregor Thomas Nov 17 '20 at 20:43
  • Now, if you know all the code chunks had `echo = TRUE`, you could do pretty good. You won't necessarily know any options specified in the YAML. And you will still be out of luck for any in-line code expressions - you won't even be able to identify those. But I doubt anyone has written a tool for that. – Gregor Thomas Nov 17 '20 at 20:46

0 Answers0