Rasterise ggplot images in R for tikzdevice
I use R to analyse data, ggplot to create plots, tikzDevice to print them and finally latex to create a report. THe problem is that large plots with many points fail due to the memory limit of latex. I found here https://github.com/yihui/tikzDevice/issues/103 a solution that rasterises the plot before printing the tikz file, which allows printing the points and the text individually. require(png) require(ggplot2) require(tikzDevice) ## generate data n=1000000; x=rnorm(n); y=rnorm(n) ## first try primitive tikz("test.tex",standAlone=TRUE) plot(x,y) dev.off() ## fails due to memory system(