ggplot causes error when executed in a knitr chunk (Rstudio)

62 views
Skip to first unread message

Timothy Wyant

unread,
Sep 4, 2015, 4:09:04 PM9/4/15
to ggplot2
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

Roman Luštrik

unread,
Sep 4, 2015, 4:33:39 PM9/4/15
to Timothy Wyant, ggplot2
Works for me on W7 64 bit, knitr_1.10.5.

Cheers,
Roman

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
In God we trust, all others bring data.

Michael Dougherty

unread,
Oct 6, 2015, 7:32:40 AM10/6/15
to ggplot2
I'm having the same problem, and it's a new problem as well. Let me know if you find a solution.

Roman Luštrik

unread,
Oct 6, 2015, 7:37:18 AM10/6/15
to Michael Dougherty, ggplot2
Works for me just fine.

Rstudio 0.99.473
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9 64-bit)

R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7600)

locale:
[1] LC_COLLATE=Slovenian_Slovenia.1250  LC_CTYPE=Slovenian_Slovenia.1250    LC_MONETARY=Slovenian_Slovenia.1250
[4] LC_NUMERIC=C                        LC_TIME=Slovenian_Slovenia.1250    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] tools_3.2.2 knitr_1.11 


Cheers,
Roman

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages