[R] plotting huge data

Frank E Harrell Jr f.harrell at vanderbilt.edu
Fri Aug 7 14:19:16 CEST 2009

gauravbhatti wrote:
> I have a data frame with 25000 rows containing two columns Time and Distance.
> When I plot a simple distance versus time plot, the plot is very confusing 
> showing no general trend because of the large data. Is there any way I can
> improve the plot by lets say using moving average as in EXCEL ? please also
> suggest some other methods to make the graph smoother and better looking.
> Gaurav

I recommend using the quantreg package to fit a quantile regression 
model using a spline function of Time.  Draw the estimated curves for 
selected quantiles such as 0.1 0.25 0.5 0.75 0.9.  A new function Rq in 
the Design package makes this easier but you can do it with just quantreg.


Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University

More information about the R-help mailing list