[R] Plotting 15 million points

David Winsemius dwinsemius at comcast.net
Fri Feb 26 00:41:54 CET 2010


On Feb 25, 2010, at 6:11 PM, Abhishek Pratap wrote:

> Hi All
>
> I have a vector of about 15 million numbers which I would like to
> plot. The goal is the see the distribution.

>  I tired the usual steps.

I get that way after a long day myself.

>
> 1. Histogram : never gets complete my window freezes w/out log base 10

What expressions?

> 2. Density  : I first calculated the kernel density and then plotted
> it which worked.
>
> It would be nice to superimpose histogram with density but as of now I
> am not able to get this data as a histogram.

?cut
?table


> I tried ggplot2 which
> also hangs.
>
> Any efficient methods to play with > 10 million numbers in a vector.

Well, I only have 4.5 million rows (in a hundred plus variable  
dataframe) but the typical commands seem to work fine. hist() gave a  
plot almost instantly:

hist(TRdta$ur_procreat, breaks=c(seq(0, 4, by=0.2), 20)  )

>
> Thanks,
> -Abhi
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT



More information about the R-help mailing list