r - TikzDevice: 'cannot create lock file' error when using grid.arrange -
i use tikz plotting device document. compile *.rnw file rstudio , error message set
dev='tikz'
the error
the error message that
error in createlockfile(lockname): cannot create lock file
this error documented in conjunction other issues (e.g. see here https://github.com/sharpie/rtikzdevice/issues/66), found issue here unrelated documented elsewhere.
a reproducible example:
please find below reproducible example:
\documentclass{scrartcl} \usepackage{color,graphicx} \usepackage{tikz} <<setup, message=false, cache=false, echo=false>>= #set chunk options here opts_chunk$set(fig.path='figure/graphics-', cache.path='cache/graphics-', fig.align='center', fig.width=13.69, fig.height=6.27, dev='tikz', fig.keep='last', cache=true, par=true, echo=false, message=false, warning=false, results= 'hide') # load ggplot library(ggplot2) @ \begin{document} \begin{figure}[h] <<plot>>= data <- data.frame(some.data = rnorm(10)) p1 <- ggplot(data, aes(x=1:10, y=some.data)) + geom_point() + ylab(expression(x[t])) p2 <- ggplot(data, aes(x=1:10, y=some.data)) + geom_line() + ylab(expression(x[t])) library(gridextra) grid.arrange(p1, p2, ncol=1) @ \end{figure} \end{document}
and session info
r version 3.0.2 (2013-09-25) platform: x86_64-w64-mingw32/x64 (64-bit) attached base packages: [1] stats graphics grdevices utils datasets methods base other attached packages: [1] tikzdevice_0.7.0 filehash_2.2-2 loaded via namespace (and not attached): [1] grid_3.0.2 tools_3.0.2
together rstudio version 0.98.501
the problem
the problem seems occur when want arrange ggplots p1 , p2 using package gridextra. i.e. when plot graphs individually without arranging them code works, seems not able handle grid.arrange command. there way arrange plots such tikz works?
many thanks!
Comments
Post a Comment