Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Knitting returns parse error

$
0
0

In attempting to knit a PDF. I'm calling a script that should return two ggplots by calling the chunk:

```{r, echo=FALSE}

read_chunk('Script.R')

```r

But receive the error

processing file: Preview-24a46368403c.Rmd

 Quitting from lines 9-12 (Preview-24a46368403c.Rmd)  Error in
 parse(text = x, srcfile = src) :    attempt to use zero-length
 variable name Calls: <Anonymous> ... <Anonymous> -> parse_all ->
 parse_all.character -> parse Execution halted

The script on its own runs and returns the two plots, but won't return them when knitted.

Similarly attempted to use source() But got a similar error

 Quitting from lines 7-10 (Preview-24a459ca4c1.Rmd)  Error in
 file(filename, "r", encoding = encoding) :    cannot open the
 connection Calls: <Anonymous> ... withCallingHandlers -> withVisible
 -> eval -> eval -> source -> file Execution halted

Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>