I am trying to make a cdf plot for data with a lot of rows, I made a function:
Cdf3<-function(a,b,c){
df <- data.frame(x = c(a$Speed,b$Speed,c$Speed),ggg = factor(rep(1:3, c(nrow(a),nrow(b),nrow(c)))))
df <- df[order(df$x), ]
df$ecdf <- ave(df$x, df$ggg, FUN=function(x) seq_along(x)/length(x))
ggplot(df, aes(x, ecdf, colour = ggg)) + geom_line() + scale_colour_hue(name="my legend", labels=c('2011','2012','2013'))
}
The message I am getting is:
Error: cannot allocate vector of size 32.0 Mb
In addition: There were 12 warnings (use warnings() to see them)
Error during wrapup: cannot allocate vector of size 32.0 Mb
I tried also to do row by row without the function and when I run row ggplot it shows the same massage, am I doing something wrong? Is there a better way to make cdf? Finally I would like to run it on 5 data sets (not just 3) and each one of them has at least 5M rows.