r - Knitting returns parse error -


in attempting knit pdf. i'm calling script should return 2 ggplots calling chunk:

```{r, echo=false}  read_chunk('script.r')  ```r 

but receive error

processing file: preview-24a46368403c.rmd   quitting lines 9-12 (preview-24a46368403c.rmd)  error in  parse(text = x, srcfile = src) :    attempt use zero-length  variable name calls: <anonymous> ... <anonymous> -> parse_all ->  parse_all.character -> parse execution halted 

the script on own runs , returns 2 plots, won't return them when knitted.

similarly attempted use source() got similar error

 quitting lines 7-10 (preview-24a459ca4c1.rmd)  error in  file(filename, "r", encoding = encoding) :    cannot open  connection calls: <anonymous> ... withcallinghandlers -> withvisible  -> eval -> eval -> source -> file execution halted 

while not appear solution you, exact same error message appears if chunk not ended properly.

i experienced error , traced ending chunk `` instead of ```. correcting syntax of chunk solved problem experienced same error message you.


Comments