Ramiro Barrantes
2015-Aug-11 13:32 UTC
[R] Error in .External2(C_X11, paste("png::", filename, sep = ""), g$width, : unable to start device PNG
Hello,
I have the following reproducible knitr document:
\documentclass{article}
\usepackage[sc]{mathpazo}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\begin{document}
<<test,dev="png",echo=FALSE>>library(lattice)
xyplot(1:2~1:2)
@
\end{document}
but knitr is giving me an error:
Quitting from lines 9-11 (test.Rnw)
Error in .External2(C_X11, paste("png::", filename, sep =
""), g$width, :
unable to start device PNG
In addition: Warning message:
In (function (filename = "Rplot%03d.png", width = 480, height = 480,
:
unable to open connection to X11 display ''
I don't have X11 installed in this machine and I was hoping not to have to.
I am guessing that this is the problem right?
Any suggestions??
Thanks,
Ramiro
[[alternative HTML version deleted]]
Yihui Xie
2015-Aug-11 13:59 UTC
[R] Error in .External2(C_X11, paste("png::", filename, sep = ""), g$width, : unable to start device PNG
>From my experience, that is often an indication that you built R fromsource but didn't pay attention to the cairo/pango dependencies. You can either install R from a repository, or make sure you have all the dependencies installed before you build R from source (e.g. for Ubuntu, use apt-get build-dep r-base-dev). Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Web: http://yihui.name On Tue, Aug 11, 2015 at 8:32 AM, Ramiro Barrantes <ramiro at precisionbioassay.com> wrote:> Hello, > > I have the following reproducible knitr document: > > \documentclass{article} > \usepackage[sc]{mathpazo} > \usepackage[T1]{fontenc} > \usepackage{geometry} > > \begin{document} > > <<test,dev="png",echo=FALSE>>> library(lattice) > xyplot(1:2~1:2) > @ > > \end{document} > > > but knitr is giving me an error: > > Quitting from lines 9-11 (test.Rnw) > Error in .External2(C_X11, paste("png::", filename, sep = ""), g$width, : > unable to start device PNG > In addition: Warning message: > In (function (filename = "Rplot%03d.png", width = 480, height = 480, : > unable to open connection to X11 display '' > > I don't have X11 installed in this machine and I was hoping not to have to. I am guessing that this is the problem right? > > Any suggestions?? > > Thanks, > Ramiro