A "compile pdf" in Rstudio of this Rnw:
\documentclass{article}
\begin{document}
Here is the test.
<<Plot_assets>>=
library(ggplot2)
data=data.frame(x=1:5,y=1:5)
ggplot( data, aes(x=x,y=y)) + geom_line()
@
\end{document}
fails with this error:
Quitting from lines 5-9 (Test.knitr.ggplot.Rnw)
Error in stri_split_regex(string, pattern, n = n, simplify = FALSE, opts_regex = attr(pattern, :
Missing closing bracket on a bracket expression. (U_REGEX_MISSING_CLOSE_BRACKET)
Calls: knit ... <Anonymous> -> str_split -> stri_split_regex -> .Call
If I comment out the ggplot line, compiles fine (with no plot, of course)
If "run all chunks" the R runs fine and produces the plot.
Problem is entirely in the ggplot line.
Have done lots of Rnw documents with ggplot. This is first time I have had a problem like this.
Rstudio version 0.99.441
Mac OS X version 10.10.5
R version 3.1.2