I have a scatter plot with many data points in it. Once I try to zoom in or save it in a pdf format, it takes a long time to open and the pdf is too large. How can I reduce the file size or make the plot lighter by keeping the same visuality of the plot. Here is an example:
library(ggplot2)
df <- data.frame(x = rnorm(50000),y=rnorm(50000))
ggplot(df,aes(x=x,y=y)) + geom_point()