R Notebook is saving but I receive an unexpected symbol error without any resolution

50 Views Asked by At

I am receiving an error when saving my R Notebook (.Rmd) file in R Studio. The notebook seems to be saving correctly but I can't figure out what is causing the error and if there is an impact of the error.

I have tried changing formatting and syntax. Nothing seems to correct it. When I remove the line of code, it picks a new line and says there is an unexpected symbol there instead.

Similar questions on stack have suggested that the problem may be the text lying in a code chunk, but my text is not in a code chunk.

Update: I am thinking this might be some sort of system or settings issue because it seems the error occurs no matter what is in my R Notebook.

Reproducible example:

---
title: "example"
output: html_notebook
---

## Sample Header
Line of text

Output when saving the .Rmd file:

> source("C:/Users/USER/Folder/notebook.Rmd")
Error in source("C:/Users/USER/Folder/notebook.Rmd") : 
  C:/Users/USER/Folder/notebook.Rmd:7:6: unexpected symbol
6: ## Sample Header
7: Line of
        ^
0

There are 0 best solutions below