Live preview of R script rendered by render/spin

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)?

I don't think source on save calling spin and not source() is implemented from an R file :thinking:

Probably a feature request for the RStudio IDE - this would require a way / detection to switch usual source() for an R file to another function.

Did you check if this was something already asked on RStudio IDE github repo ?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.