0

On RStudio 2022.02.0 open new R notebook, change nothing, check 'Preview on Save', save document, and I get the following console output:

source("~/Desktop/file.Rmd")
Error in source("~/Desktop/file.Rmd") : 
  ~/Desktop/file.Rmd:6:6: unexpected symbol
5: 
6: This is
        ^

The error started on a doc I was working on, but is now occurring on all r notebooks I run. Just pushing the 'Preview' button works fine. I have made no recent changes to the r or Rstudio set-up. The feature worked fine up until a week ago.

Hal
  • 75
  • 6
  • i don't see a "preview on save" option, but .Rmd files need to be knitted not sourced. sourcing is for pure r code... are you saying that clicking preview causes the rmd to be sourced? – rawr Apr 25 '22 at 07:59
  • In RStudio there is, to the left of the save icon, at the top, below the document tab names, a box that can be check named 'Preview on Save'. If I check this and then save the document (either by pushing save or cmd+S) I get the stated output. I did not write anything to console, nor did I click 'Preview'. – Hal Apr 25 '22 at 08:14

0 Answers0