When writing a .Rmd document, I can achieve a live preview by checking the 'Source on save' option, and by selecting 'Preview in viewer pane' in the options in the taskbar above the document.
However, I prefer to write .R scripts using roxygen comments, and use rmarkdown::render to
generate the output (I think it is calling knitr::spin in the background). Is there any way I can have a live preview of the html output or render, generated by an .R file, in the viewer pane, that updates as soon as I save the document (using source on save)?