Reduce PDF file size of plots by filtering hidden objects
As a start you can do something like this:
set.seed(42)
DF <- data.frame(x=x<-runif(1e6),y=x+rnorm(1e6,sd=0.1))
plot(y~x,data=DF,pch=".",cex=4)
PDF size: 6334 KB
DF2 <- data.frame(x=round(DF$x,3),y=round(DF$y,3))
DF2 <- DF[!duplicated(DF2),]
nrow(DF2)
#[1] 373429
plot(y~x,data=DF2,pch=".",cex=4)
PDF size: 2373 KB
With the rounding you can control how many values you want to remove. You only need to modify this to handle the different colours.
Writing printer friendly pdfs with ggplot2 and many ( 25000) dots or lines
The only solution I found so far is the following: https://helpx.adobe.com/acrobat/kb/quick-fix-print-pdf-image.html
I think this might be the best way since the creation of PDF is the same, you just switch to "print as image" in the advance printing dialog in Acrobat Reader...
Related Topics
Building R Package and Error "Ld: Cannot Find -Lgfortran"
Why Does R Use Partial Matching
Transposing a Dataframe Maintaining the First Column as Heading
Ggplot Separate Legend and Plot
What's the Best Way to Use R Scripts on the Command Line (Terminal)
Element-Wise Mean Over List of Matrices
Draw the Sum Value Above the Stacked Bar in Ggplot2
R Apply Function with Multiple Parameters
Why Is Enquo + !! Preferable to Substitute + Eval
When Importing CSV into R How to Generate Column with Name of the CSV
Remove All Punctuation Except Apostrophes in R
R Knitr Chunk Options for Figure Height/Width Are Not Working
Drop-Down Checkbox Input in Shiny
Reading Multiple Files and Calculating Mean Based on User Input
Insert Picture/Table in R Markdown