Instead of taking every nth point, can you quantize your data to a sufficient resolution before building it? Thus, you do not have to display a resolution that you do not need (or not visible).
Here is one way to do it. (The function I wrote below is generic, but the example uses the names from your question.)
library(ggplot2) library(plyr)
While the original dataset and ecdf set had 110 lines, the quantized-ecdf set was greatly reduced:
> dim(tens) [1] 110 2 > dim(tens_cdf) [1] 110 3 > dim(tens_cdfq) [1] 10 3 > tens_cdfq Type value value_ecdf 1 1 0 0.00 2 1 25 0.25 3 1 50 0.50 4 1 75 0.75 5 1 100 1.00 6 10 0 0.00 7 10 25 0.20 8 10 50 0.50 9 10 75 0.70 10 10 100 1.00
Hope this helps! :-)
source share